summaryrefslogtreecommitdiffstats
path: root/.config
diff options
context:
space:
mode:
Diffstat (limited to '.config')
-rwxr-xr-x.config/nvim/init.vim57
1 files changed, 20 insertions, 37 deletions
diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim
index 06992d0..2bb1324 100755
--- a/.config/nvim/init.vim
+++ b/.config/nvim/init.vim
@@ -42,8 +42,11 @@ Plug 'godlygeek/tabular'
42Plug 'dbeniamine/cheat.sh-vim' 42Plug 'dbeniamine/cheat.sh-vim'
43"color code highlight 43"color code highlight
44Plug 'chrisbra/Colorizer' 44Plug 'chrisbra/Colorizer'
45
45"comment helper 46"comment helper
46Plug 'scrooloose/nerdcommenter' 47"Plug 'scrooloose/nerdcommenter'
48Plug 'tpope/vim-commentary'
49
47"folding ledger files 50"folding ledger files
48Plug 'ledger/vim-ledger' 51Plug 'ledger/vim-ledger'
49"reporen files at your last edit position 52"reporen files at your last edit position
@@ -52,9 +55,14 @@ Plug 'farmergreg/vim-lastplace'
52Plug 'kshenoy/vim-signature' 55Plug 'kshenoy/vim-signature'
53"git diff in the sign column 56"git diff in the sign column
54Plug 'airblade/vim-gitgutter' 57Plug 'airblade/vim-gitgutter'
58"jump to location by 2 characters
59Plug 'justinmk/vim-sneak'
55 60
61"splits delete into cut and delete
56Plug 'svermeulen/vim-cutlass' 62Plug 'svermeulen/vim-cutlass'
63"change text with yank
57Plug 'svermeulen/vim-subversive' 64Plug 'svermeulen/vim-subversive'
65"yank history
58Plug 'svermeulen/vim-yoink' 66Plug 'svermeulen/vim-yoink'
59 67
60"enable repeating supported plugin maps with '.' 68"enable repeating supported plugin maps with '.'
@@ -69,9 +77,7 @@ Plug 'tpope/vim-fugitive'
69Plug 'tpope/vim-speeddating' 77Plug 'tpope/vim-speeddating'
70"search, substitute and abbreviate 78"search, substitute and abbreviate
71Plug 'tpope/vim-abolish' 79Plug 'tpope/vim-abolish'
72"helpers for unix 80"provides ga, show unicode stuff of char under cursor
73Plug 'tpope/vim-eunuch'
74"unicode character metadata
75Plug 'tpope/vim-characterize' 81Plug 'tpope/vim-characterize'
76 82
77"fancy start screen 83"fancy start screen
@@ -98,18 +104,14 @@ autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isT
98"{{{Misc Settings 104"{{{Misc Settings
99 105
100let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py' 106let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py'
101
102" necesary for lots of cool vim things 107" necesary for lots of cool vim things
103set nocompatible 108set nocompatible
104
105" See below 109" See below
106" https://stackoverflow.com/a/33380495 110" https://stackoverflow.com/a/33380495
107if !exists("g:syntax_on") 111if !exists("g:syntax_on")
108 syntax enable 112 syntax enable
109endif 113endif
110
111set grepprg=grep\ -nH\ $* " DONT KNOW WHAT THIS DOES 114set grepprg=grep\ -nH\ $* " DONT KNOW WHAT THIS DOES
112
113" Tab stuff 115" Tab stuff
114set autoindent 116set autoindent
115set expandtab " Use appropriate number of spaces to insert a <Tab> 117set expandtab " Use appropriate number of spaces to insert a <Tab>
@@ -117,16 +119,13 @@ set smarttab
117set shiftwidth=4 119set shiftwidth=4
118set softtabstop=4 120set softtabstop=4
119set tabstop=8 121set tabstop=8
120
121" Use english for spellchecking, but don't spellcheck by default 122" Use english for spellchecking, but don't spellcheck by default
122set spell spelllang=en_us 123set spell spelllang=en_us
123set nospell 124set nospell
124
125" Cool tab completion stuff 125" Cool tab completion stuff
126set wildmenu 126set wildmenu
127set wildmode=list:longest,full 127set wildmode=list:longest,full
128set wildignore=*.o,*.obj,*.class 128set wildignore=*.o,*.obj,*.class
129
130set encoding=utf-8 129set encoding=utf-8
131set scrolloff=4 " Keep n lines above/below cursor 130set scrolloff=4 " Keep n lines above/below cursor
132set mouse=c 131set mouse=c
@@ -143,19 +142,12 @@ set showmatch " jump to the matching bracket briefly, REMOVE AFTER TESTING
143set linebreak " wrap using 'breakat' character 142set linebreak " wrap using 'breakat' character
144set splitbelow " new split panes will split to below and right 143set splitbelow " new split panes will split to below and right
145set splitright 144set splitright
146
147" persistent undo 145" persistent undo
148set undodir=~/.vim/undodir 146set undodir=~/.vim/undodir
149set undofile 147set undofile
150
151" lower case searches ignore case, upper case searches do not 148" lower case searches ignore case, upper case searches do not
152set ignorecase 149set ignorecase
153set smartcase 150set smartcase
154
155" This is totally awesome - remap jj to escape in insert mode. You'll never type jj anyway, so it's great!
156inoremap jj <Esc>
157nnoremap JJJJ <Nop>
158
159" https://stackoverflow.com/a/3445040/ 151" https://stackoverflow.com/a/3445040/
160" switch case labels 152" switch case labels
161set cinoptions=l1 153set cinoptions=l1
@@ -216,60 +208,47 @@ endfunction
216 208
217" Open Url on this line with the browser \w 209" Open Url on this line with the browser \w
218map <Leader>w :call Browser ()<CR> 210map <Leader>w :call Browser ()<CR>
219
220" Open the TagBar Plugin <F3> 211" Open the TagBar Plugin <F3>
221nnoremap <silent> <F3> :TagbarToggle<CR> 212nnoremap <silent> <F3> :TagbarToggle<CR>
222
223" Open NERDTree <F4> 213" Open NERDTree <F4>
224nnoremap <silent> <F4> :NERDTreeToggle<CR> 214nnoremap <silent> <F4> :NERDTreeToggle<CR>
225
226" Next Tab 215" Next Tab
227nnoremap <silent> <C-Right> :tabnext<CR> 216nnoremap <silent> <C-Right> :tabnext<CR>
228
229" Previous Tab 217" Previous Tab
230nnoremap <silent> <C-Left> :tabprevious<CR> 218nnoremap <silent> <C-Left> :tabprevious<CR>
231
232" New Tab 219" New Tab
233nnoremap <silent> <C-t> :tabnew<CR> 220nnoremap <silent> <C-t> :tabnew<CR>
234
235" Rotate Color Scheme <F8> 221" Rotate Color Scheme <F8>
236"nnoremap <silent> <F8> :execute RotateColorTheme()<CR> 222"nnoremap <silent> <F8> :execute RotateColorTheme()<CR>
237
238" FixIt from YCM 223" FixIt from YCM
239map <F9> :YcmCompleter FixIt<CR> 224map <F9> :YcmCompleter FixIt<CR>
240
241" Edit vimrc \ev 225" Edit vimrc \ev
242nnoremap <silent> <Leader>ev :tabnew<CR>:e ~/.config/nvim/init.vim<CR> 226nnoremap <silent> <Leader>ev :tabnew<CR>:e ~/.config/nvim/init.vim<CR>
243
244" Up and down are more logical with g.. 227" Up and down are more logical with g..
245nnoremap <silent> k gk 228nnoremap <silent> k gk
246nnoremap <silent> j gj 229nnoremap <silent> j gj
247inoremap <silent> <Up> <Esc>gka 230inoremap <silent> <Up> <Esc>gka
248inoremap <silent> <Down> <Esc>gja 231inoremap <silent> <Down> <Esc>gja
249 232" This is totally awesome - remap jj to escape in insert mode. You'll never type jj anyway, so it's great!
233inoremap jj <Esc>
234nnoremap JJJJ <Nop>
250" quicker window movement 235" quicker window movement
251nnoremap <C-j> <C-w>j 236nnoremap <C-j> <C-w>j
252nnoremap <C-k> <C-w>k 237nnoremap <C-k> <C-w>k
253nnoremap <C-h> <C-w>h 238nnoremap <C-h> <C-w>h
254nnoremap <C-l> <C-w>l 239nnoremap <C-l> <C-w>l
255
256" Disable highlight when <leader><cr> is pressed 240" Disable highlight when <leader><cr> is pressed
257map <silent> <leader><cr> :noh<cr> 241map <silent> <leader><cr> :noh<cr>
258
259" Space will toggle folds! 242" Space will toggle folds!
260nnoremap <space> za 243nnoremap <space> za
261
262" Search mappings: These will make it so that going to the next one in a 244" Search mappings: These will make it so that going to the next one in a
263" search will center on the line it's found in. 245" search will center on the line it's found in.
264map N Nzz 246map N Nzz
265map n nzz 247map n nzz
266
267"Insert timestamp 248"Insert timestamp
268nnoremap <F5> "=strftime("%F %T")<CR>P 249nnoremap <F5> "=strftime("%F %T")<CR>P
269inoremap <F5> <C-R>=strftime("%F %T")<CR> 250inoremap <F5> <C-R>=strftime("%F %T")<CR>
270
271nnoremap <Leader>t "=strftime("%F")<CR>P 251nnoremap <Leader>t "=strftime("%F")<CR>P
272
273"}}} 252"}}}
274 253
275"{{{Tagbar 254"{{{Tagbar
@@ -399,14 +378,18 @@ map <Leader>b <Plug>VimwikiToggleListItem
399set clipboard=unnamed,unnamedplus 378set clipboard=unnamed,unnamedplus
400 379
401" s for substitute 380" s for substitute
402nmap s <plug>(SubversiveSubstitute) 381nmap <leader>ys <plug>(SubversiveSubstitute)
403nmap ss <plug>(SubversiveSubstituteLine) 382nmap <leader>yss <plug>(SubversiveSubstituteLine)
404nmap S <plug>(SubversiveSubstituteToEndOfLine) 383nmap <leader>yS <plug>(SubversiveSubstituteToEndOfLine)
405 384
406nmap <leader>s <plug>(SubversiveSubstituteRange) 385nmap <leader>s <plug>(SubversiveSubstituteRange)
407xmap <leader>s <plug>(SubversiveSubstituteRange) 386xmap <leader>s <plug>(SubversiveSubstituteRange)
408nmap <leader>ss <plug>(SubversiveSubstituteWordRange) 387nmap <leader>ss <plug>(SubversiveSubstituteWordRange)
409 388
389nmap <leader><leader>s <plug>(SubversiveSubvertRange)
390xmap <leader><leader>s <plug>(SubversiveSubvertRange)
391nmap <leader><leader>ss <plug>(SubversiveSubvertWordRange)
392
410nmap <c-n> <plug>(YoinkPostPasteSwapBack) 393nmap <c-n> <plug>(YoinkPostPasteSwapBack)
411nmap <c-p> <plug>(YoinkPostPasteSwapForward) 394nmap <c-p> <plug>(YoinkPostPasteSwapForward)
412 395