Repository navigation
Expand file tree
/
Copy pathtim.nvim.settings.vim
More file actions
247 lines (188 loc) · 6.03 KB
/
Copy pathtim.nvim.settings.vim
File metadata and controls
247 lines (188 loc) · 6.03 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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
" Neovim settings (plugins managed by lazy.nvim)
set nocompatible
filetype plugin indent on
let g:airline_theme='molokai'
" Easy motion
let g:EasyMotion_do_mapping = 0 " Disable default mappings
" Jump to anywhere you want with minimal keystrokes, with just one key binding.
" `s{char}{label}`
" nmap s <Plug>(easymotion-overwin-f)
" or
" `s{char}{char}{label}`
" Need one more keystroke, but on average, it may be more comfortable.
nmap <Leader>f <Plug>(easymotion-overwin-f2)
" Turn on case insensitive feature
let g:EasyMotion_smartcase = 1
" Spacing delimeter
let g:NERDSpaceDelims = 1
" JK motions: Line motions
map <Leader>j <Plug>(easymotion-j)
map <Leader>k <Plug>(easymotion-k)
" Prompts
let PROMPT="vim: "
" helpful maps
nmap <S-Tab> <<
imap <S-Tab> <C-d>
" NERDTree
"let NERDTreeWinSize=60
"let NERDTreeQuitOnOpen=1
"noremap <silent> <Leader>t :set columns=180<CR>:NERDTreeToggle<CR>
"autocmd StdinReadPre * let s:std_in=1
"autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
"autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif
"autocmd BufEnter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
"autocmd BufEnter * wincmd p
" Comments
let g:EnhCommentifyPretty = 'Yes'
let g:EnhCommentifyBindInNormal = 'Yes'
let g:EnhCommentifyBindInVisual = 'Yes'
let g:EnhCommentifyBindInInsert = 'No'
" show tabs
set list
" Folds
set foldmethod=indent
set fdc=1
set nofoldenable
" Tabs and indents
set expandtab
set tabstop=2
set sw=2
set cinoptions+=(0,W1s
" indent-guides
let g:indent_guides_enable_on_vim_startup=1
" Completion
set completeopt=longest,menuone
inoremap <expr> <cr> pumvisible() ? "\<c-y>" : "\<c-g>u\<cr>"
inoremap <expr> <c-n> pumvisible() ? "\<lt>c-n>" : "\<lt>c-n>\<lt>c-r>=pumvisible() ? \"\\<lt>down>\" : \"\"\<lt>cr>"
inoremap <expr> <m-;> pumvisible() ? "\<lt>c-n>" : "\<lt>c-x>\<lt>c-o>\<lt>c-n>\<lt>c-p>\<lt>c-r>=pumvisible() ? \"\\<lt>down>\" : \"\"\<lt>cr>"
" This lets us backspace past lines
set backspace=2
setglobal fileformat=unix
set ruler
" have some borders when doing z <key> commands
set scrolloff=4
" no case
set ignorecase
" get rid of messages
set ch=2
set laststatus=2
" line numbers
set number
" auto complete settings
set cpt=.,b,u,i,]
" syntax settings
let c_comment_strings=1
syntax on
set hlsearch
set incsearch
set showfulltag
" set some line options
set showbreak=++++
" some cleanup stuff
set shortmess=imnrwx
" Lets keep some global viminfo
set viminfo='20,\"50
" Map `7 to underline with C++-style comments
nmap `7 yyPj:.,. s/./-/g<CR>r/lr/lr 0:let@/=histget( '/', -2 )<CR>:ec<CR>
vmap `7 <Esc>`7
" Map `8 to underline with C-style comments
nmap `8 yyPj:.,. s/./*/g<CR>r/$r/0:let@/=histget( '/', -2 )<CR>:ec<CR>
vmap `8 <Esc>`8
" Map `9 to have a line of C++-style comments inserted above
nmap `9 O// <Esc>A-<Esc>75.0
imap `9 <Esc>`9
vmap `9 <Esc>`9
" Map `0 to have a line of C-style comments inserted above
nmap `0 O/<Esc>A*<Esc>76.A/<Esc>0
imap `0 <Esc>`0
vmap `0 <Esc>`0
" Map _C to clear search
nmap _C :let@/=''<CR>:ec<CR>
vmap _C <Esc>_C
" Map _U to just have 79 - underlining
nmap _U o<Esc>I-<Esc>78.0
vmap _U <Esc>_U
" Mapping for switching buffers
nmap <F6> :previous<CR>
imap <F6> <C-O>:previous<CR>
nmap <F7> :next<CR>
imap <F7> <C-O>:next<CR>
nmap <F8> :bprevious<CR>
imap <F8> <C-O>:bprevious<CR>
nmap <F9> :bnext<CR>
imap <F9> <C-O>:bnext<CR>
" map prev/next tag
nmap tn :tn<CR>
nmap tp :tp<CR>
" map for grep.
nmap gn :cnext<CR>
nmap gp :cprev<CR>
" maps for search
nnoremap <Leader>s :%s/\<<C-r><C-w>\>/
" Put all the swap files in g:\temp
" set dir=$TEMP
set backupdir=/tmp
set directory=/tmp
" set the tag search
set tags=$VIM\doc\tags,$VIM_TAG_FILES,.\tags
" EasyTags
let g:easytags_events = ['BufReadPost', 'BufWritePost']
let g:easytags_async = 1
let g:easytags_dynamic_files = 2
let g:easytags_resolve_links = 1
let g:easytags_suppress_ctags_warning = 1
nmap <silent> <leader>b :TagbarToggle<CR>
" set the path to search for include files
set path=.,$VIM_FILES_PATH
" set wildignore
set wildignore+=*.class
" Autocmds for F# files
autocmd BufRead,BufNewFile *.fs,*.fsx,*.fsi,*.ml set mat=2 sm
" Autocmds for C/C++ files.
autocmd BufRead,BufNewFile *.java,*.cs,*.c,*.cpp,*.h,*.hpp,*.idl set sm mat=2
" Autocmds for VB files
autocmd BufRead,BufNewFile *.vb setlocal filetype=vbnet
" Autocmds for Ruby files
autocmd BufRead,BufNewFile *.rb set sw=2 tabstop=2
autocmd BufRead,BufNewFile *.erb set sw=2 tabstop=2
autocmd BufRead,BufNewFile *.yml set sw=2 tabstop=2
autocmd FileType ruby,eruby call UseRubyIndent()
" Autocmds for CSS
autocmd BufRead,BufNewFile *.html set sw=2 tabstop=2
autocmd BufRead,BufNewFile *.css set sw=2 tabstop=2
" Autocmds for JS
autocmd BufRead,BufNewFile *.js set sw=2 tabstop=2
autocmd BufRead,BufNewFile *.json set sw=2 tabstop=2
autocmd BufRead,BufNewFile *.ts set sw=2 tabstop=2
" Autocmds for asp/aspx
autocmd BufRead,BufNewFile *.asp,*.aspx set sw=4 tabstop=4
" Autocmds for makefiles
autocmd BufRead,BufNewFile makefile,*.mak,*.mif set noexpandtab tabstop=4 sw=4
" Autocmds XML
autocmd BufRead,BufNewFile *.xml set sw=2 tabstop=2
" Autocmds XAML
autocmd BufRead,BufNewFile *.xaml set sw=2 tabstop=2
" Autocmds VIM
autocmd BufRead,BufNewFile *.vim set sw=4 tabstop=4
" .<TAB> replacements.
autocmd BufRead,BufNewFile *.cpp,*.h imap .<tab> this->
autocmd BufRead,BufNewFile *.cs,*.java imap .<tab> this.
autocmd BufRead,BufNewFile *.vb imap .<tab> Me.
" All files
autocmd BufRead,BufNewFile * set fo=ql
" On entering a buffer, change the current directory to the file.
" I'm using a :CD command rather then BufEnter for now.
" autocmd BufEnter * execute ":lcd " . expand("%:p:h")
com! CD cd %:p:h
" some options
set cpo+=$
" Colors (set after colorscheme loads in init.lua)
hi Normal guifg=lightgrey guibg=black
hi Search guibg=red guifg=black
hi Incsearch guibg=black guifg=lightblue
hi Visual guifg=lightgrey guibg=black
hi NonText guifg=#800000 guibg=black
hi Type guifg=darkgreen
set listchars=extends:+,tab:>-,trail:+
let molokai_original = 1
set background=dark