-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc.vim
More file actions
211 lines (173 loc) · 5.09 KB
/
Copy pathvimrc.vim
File metadata and controls
211 lines (173 loc) · 5.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
let mapleader = ","
set nocompatible " be iMproved, required
" Assumes vim-plug is installed at `${HOME}/.vim/autoload`
" > https://github.com/junegunn/vim-plug
filetype off " required
"
" setup OS detection for later use
"
if !exists("g:os") || !exists("g:pluggedloc") || !exists("g:vimconfig")
if has("win64") || has("win32") || has("win16")
let g:os = "Windows"
let g:pluggedloc = '~/vimfiles/plugged'
let g:vimconfig = '~/vimfiles'
else
let g:os = substitute(system('uname'), '\n', '', '')
let g:pluggedloc = '~/.config/nvim/plugged'
let g:vimconfig = '~/.config/nvim'
endif
endif
if executable('asdf')
let g:python_host_prog = '~/.asdf/installs/python/2.7.18/bin/python'
let g:python3_host_prog = '~/.asdf/installs/python/3.12.0/bin/python'
endif
call plug#begin(g:pluggedloc)
" General environment improvement
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rhubarb'
Plug 'tpope/vim-db'
Plug 'tpope/vim-jdaddy'
Plug 'tpope/vim-eunuch'
Plug 'tpope/vim-dadbod'
Plug 'nelstrom/vim-visual-star-search'
Plug 'ryanoasis/vim-devicons'
Plug 'ap/vim-css-color'
Plug 'mhinz/vim-startify'
"Plug ''
"status line
"
"Plug 'powerline/powerline'
Plug 'itchyny/lightline.vim'
Plug 'ervandew/supertab'
" Need to have exuberant ctags installed for tagbar
Plug 'preservim/tagbar'
" UtiliSnips; https://github.com/SirVer/ultisnips
" also see https://github.com/panozzaj/conf/blob/master/common/.vim/UltiSnips/javascript.snippets
"Plug 'SirVer/ultisnips'
Plug 'sotte/presenting.vim'
Plug 'mileszs/ack.vim'
Plug 'aquach/vim-http-client'
Plug 'Keithbsmiley/investigate.vim'
Plug 'BurntSushi/ripgrep'
" Navigation
Plug 'scrooloose/nerdtree'
Plug 'scrooloose/nerdcommenter'
if g:os == "Linux" || g:os == "Darwin"
Plug 'xuyuanp/nerdtree-git-plugin'
endif
Plug 'vim-scripts/genutils'
Plug 'vim-scripts/SelectBuf'
" Specific stack support
Plug 'chrisbra/csv.vim'
Plug 'kchmck/vim-coffee-script'
Plug 'ekalinin/Dockerfile.vim'
Plug 'neo4j-contrib/cypher-vim-syntax'
Plug 'isobit/vim-caddyfile'
Plug 'earthly/earthly.vim'
Plug 'mtvee/vim-fossil'
"Plug 'nicr9/vim-orca'
"
"
"Vim only
"Plugin 'Shougo/vimproc.vim'
"Plugin 'Shougo/vimshell.vim'
if g:os == "Windows"
Plug 'codecleric/simpleterm.vim'
endif
"Plug 'elzr/vim-json'
"
" JavaScript stack -- updated from https://davidosomething.com/blog/vim-for-javascript/
Plug 'jsy-lang/vim-jsy'
Plug 'jelera/vim-javascript-syntax'
" Plug 'mxw/vim-jsx'
Plug 'moll/vim-node' " jump through require statements
Plug 'wavded/vim-stylus'
Plug 'leafgarland/typescript-vim'
Plug 'gutenye/json5.vim'
Plug 'ap/vim-css-color'
Plug 'Quramy/vim-js-pretty-template'
" End JavaScript stack
"
Plug 'gabrielelana/vim-markdown'
Plug 'farfanoide/vim-kivy'
" Themes
Plug 'nanotech/jellybeans.vim'
Plug 'flazz/vim-colorschemes'
Plug 'drmikehenry/vim-fontsize'
"Plug 'nathangrigg/vim-beancount'
"
if has('nvim')
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.5' }
endif
call plug#end() " required
" fugitive stuff
filetype plugin indent on " required
set encoding=UTF-8
if g:os == "Windows"
set swapfile
set dir=~/.swap-files
else
set noswapfile
endif
set nobackup
set expandtab shiftwidth=2 tabstop=2
let g:lightline = {
\ 'colorscheme': 'wombat',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component_function': {
\ 'gitbranch': 'FugitiveHead',
\ 'filename': 'LightlineTruncatedFilename'
\ },
\ }
function! LightlineTruncatedFilename()
return pathshorten(expand('%:p'), 3)
endfunction
"set modelines=0
set cursorline
set nopaste
set nowrap
set number
set nowritebackup
set hlsearch
if !empty(glob(expand("~/.nvimlocal.vim")))
source ~/.nvimlocal.vim
endif
let nvimlua = expand(g:vimconfig) . '/nvimsetup.lua'
if has('nvim')
Plug 'nvim-lua/plenary.nvim'
exec "source " . nvimlua
endif
set wildmenu
set wildmode=full
let $TMPDIR=$HOME . '/tmp'
"
" Set up guifonts
"
let fontfile = expand(g:vimconfig) . '/fontsetup.vim'
exec "source " . fontfile
" learn vimscript the hard way stuff
"
" When in insert mode, <leader>Ctrl-u will select the current word, uppercase it and
" go back into insert mode
:inoremap <dn><c-u> <esc>viwUi
" When in normal mode, <leader>ev will edit your ~/.vimrc file
":nnoremap <leader>ev :vsplit $MYVIMRC<cr>
:nnoremap <leader>ev :vsplit ~/.config/nvim/init.vim<cr>
" When in normal mode, <leader>sv will source your ~/.vimrc file
:nnoremap <leader>sv :source $MYVIMRC<cr>
" Surround the visually selected area with quotes
:vnoremap <leader>" <esc>`<i"<esc>`>a"<esc>
" Cap H goes to the beginning of the line
:nnoremap H ^
" Cap L goes to the end of the line
:nnoremap L $
"jk to get out of insert mode
:inoremap jk <esc>
:nnoremap <leader>" viw<esc>a"<esc>bi"<esc>lel
:vnoremap <leader>' <esc>`>a"<esc>`<i"<esc>lel