[nvim] New changes
This commit is contained in:
parent
aa46c03bba
commit
924e80f68e
1 changed files with 59 additions and 27 deletions
|
@ -24,7 +24,7 @@ let g:tex_conceal='' " I said no conceals
|
||||||
set shell=/bin/zsh " use zsh instead of bash
|
set shell=/bin/zsh " use zsh instead of bash
|
||||||
|
|
||||||
set number " line numbers on the left side
|
set number " line numbers on the left side
|
||||||
set relativenumber " number+relativenumber = relative numbers for all but current line
|
"set relativenumber " number+relativenumber = relative numbers for all but current line
|
||||||
" toggle hybrid relative numbers when entering/leaving insert mode
|
" toggle hybrid relative numbers when entering/leaving insert mode
|
||||||
":augroup numbertoggle
|
":augroup numbertoggle
|
||||||
": autocmd!
|
": autocmd!
|
||||||
|
@ -43,6 +43,22 @@ set ignorecase smartcase " don't match case if typing in all-lowercase
|
||||||
" Ctrl+Backspace deletes previous word like in most text editors
|
" Ctrl+Backspace deletes previous word like in most text editors
|
||||||
inoremap <esc>dba<bs>
|
inoremap <esc>dba<bs>
|
||||||
|
|
||||||
|
" Useless mode that I only activate accidentally
|
||||||
|
nnoremap Q <Nop>
|
||||||
|
|
||||||
|
" Remove trailing whitespace on save {{{2
|
||||||
|
fun! CleanExtraSpaces()
|
||||||
|
let save_cursor = getpos(".")
|
||||||
|
let old_query = getreg('/')
|
||||||
|
silent! %s/\s\+$//e
|
||||||
|
call setpos('.', save_cursor)
|
||||||
|
call setreg('/', old_query)
|
||||||
|
endfun
|
||||||
|
|
||||||
|
if has("autocmd")
|
||||||
|
autocmd BufWritePre *.txt,*.js,*.py,*.wiki,*.sh,*.coffee :call CleanExtraSpaces()
|
||||||
|
endif
|
||||||
|
|
||||||
" Switching buffers {{{2
|
" Switching buffers {{{2
|
||||||
nnoremap <silent> <F14> :bprev<cr> " s-F2
|
nnoremap <silent> <F14> :bprev<cr> " s-F2
|
||||||
nnoremap <silent> <F15> :bnext<cr> " s-F3
|
nnoremap <silent> <F15> :bnext<cr> " s-F3
|
||||||
|
@ -103,10 +119,10 @@ inoremap <home> <esc>^i
|
||||||
|
|
||||||
" System clipboard {{{2
|
" System clipboard {{{2
|
||||||
" Copy to clipboard " Paste from clipboard
|
" Copy to clipboard " Paste from clipboard
|
||||||
vnoremap <leader>y "+y | nnoremap <leader>p "+p
|
vnoremap <leader>y "+y | vnoremap <leader>d "+d | nnoremap <leader>p "+p
|
||||||
nnoremap <leader>Y "+yg_ | nnoremap <leader>P "+P
|
nnoremap <leader>Y "+yg_ | nnoremap <leader>D "+dg_ | nnoremap <leader>P "+P
|
||||||
nnoremap <leader>y "+y | vnoremap <leader>p "+p
|
nnoremap <leader>y "+y | nnoremap <leader>y "+d | vnoremap <leader>p "+p
|
||||||
nnoremap <leader>yy "+yy | vnoremap <leader>P "+P
|
nnoremap <leader>yy "+yy | nnoremap <leader>dd "+dd | vnoremap <leader>P "+P
|
||||||
|
|
||||||
" Opening windows {{{2
|
" Opening windows {{{2
|
||||||
nnoremap <C-j> <C-w>j
|
nnoremap <C-j> <C-w>j
|
||||||
|
@ -192,6 +208,8 @@ set undofile
|
||||||
set directory^=/tmp/vim-swapfile//
|
set directory^=/tmp/vim-swapfile//
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
" Plug-ins {{{1
|
" Plug-ins {{{1
|
||||||
" =============
|
" =============
|
||||||
|
|
||||||
|
@ -210,7 +228,7 @@ call plug#begin('~/.config/nvim/plug')
|
||||||
"Plug 'neovimhaskell/haskell-vim', { 'for': 'haskell' } " included in vim-polyglot
|
"Plug 'neovimhaskell/haskell-vim', { 'for': 'haskell' } " included in vim-polyglot
|
||||||
"Plug 'LaTeX-Box-Team/LaTeX-Box', { 'for': 'tex' } " included in vim-polyglot
|
"Plug 'LaTeX-Box-Team/LaTeX-Box', { 'for': 'tex' } " included in vim-polyglot
|
||||||
"Plug 'rust-lang/rust.vim', { 'for': 'rust' } " included in vim-polyglot
|
"Plug 'rust-lang/rust.vim', { 'for': 'rust' } " included in vim-polyglot
|
||||||
"Plug 'ap/vim-css-color' " CSS color names
|
Plug 'ap/vim-css-color' " CSS color names
|
||||||
|
|
||||||
" C/C++
|
" C/C++
|
||||||
"Plug 'vim-scripts/c.vim', { 'for': ['c', 'cpp', 'objc'] } " various IDE-like C features
|
"Plug 'vim-scripts/c.vim', { 'for': ['c', 'cpp', 'objc'] } " various IDE-like C features
|
||||||
|
@ -218,9 +236,9 @@ call plug#begin('~/.config/nvim/plug')
|
||||||
"Plug 'derekwyatt/vim-fswitch', { 'for': ['c', 'cpp', 'objc'] } " switch between companion source files (e.g. .h and .cpp)
|
"Plug 'derekwyatt/vim-fswitch', { 'for': ['c', 'cpp', 'objc'] } " switch between companion source files (e.g. .h and .cpp)
|
||||||
Plug 'derekwyatt/vim-fswitch', { 'on': 'FSRight' } " switch between companion source files (e.g. .h and .cpp)
|
Plug 'derekwyatt/vim-fswitch', { 'on': 'FSRight' } " switch between companion source files (e.g. .h and .cpp)
|
||||||
"Plug 'derekwyatt/vim-protodef', { 'for': ['c', 'cpp', 'objc'] } " pull in C++ function prototypes into implementation files
|
"Plug 'derekwyatt/vim-protodef', { 'for': ['c', 'cpp', 'objc'] } " pull in C++ function prototypes into implementation files
|
||||||
Plug 'vim-scripts/Conque-GDB', { 'for': ['c', 'cpp', 'objc'] } " GDB command line interface and terminal emulator
|
"Plug 'vim-scripts/Conque-GDB', { 'for': ['c', 'cpp', 'objc'] } " GDB command line interface and terminal emulator
|
||||||
"Plug 'Shougo/vimproc.vim', { 'do': 'make' } " dependency of vim-vebugger, asynchronous execution library
|
Plug 'Shougo/vimproc.vim', { 'do': 'make' } " dependency of vim-vebugger, asynchronous execution library
|
||||||
"Plug 'idanarye/vim-vebugger', { 'for': ['c', 'cpp', 'objc', 'java', 'python', 'ruby'] } " debugger frontend for GDB, LDB, PDB, RDebug e.a.
|
Plug 'idanarye/vim-vebugger', { 'for': ['c', 'cpp', 'objc', 'java', 'python', 'ruby'] } " debugger frontend for GDB, LDB, PDB, RDebug e.a.
|
||||||
|
|
||||||
" Edit
|
" Edit
|
||||||
"Plug 'jiangmiao/auto-pairs' " insert or delete [], (), '' etc. in pairs
|
"Plug 'jiangmiao/auto-pairs' " insert or delete [], (), '' etc. in pairs
|
||||||
|
@ -262,6 +280,7 @@ call plug#begin('~/.config/nvim/plug')
|
||||||
"Plug 'kassio/neoterm', { 'on': 'T' } " wrapper of some neovim's :terminal functions
|
"Plug 'kassio/neoterm', { 'on': 'T' } " wrapper of some neovim's :terminal functions
|
||||||
"Plug 'tpope/vim-fugitive' " a Git wrapper
|
"Plug 'tpope/vim-fugitive' " a Git wrapper
|
||||||
"Plug 'vim-scripts/TeTrIs.vim' " Tetris clone
|
"Plug 'vim-scripts/TeTrIs.vim' " Tetris clone
|
||||||
|
Plug 'ledger/vim-ledger', { 'for': ['journal'] } " accounting with ledger
|
||||||
|
|
||||||
call plug#end()"
|
call plug#end()"
|
||||||
|
|
||||||
|
@ -278,6 +297,7 @@ hi Comment guifg=#888888
|
||||||
hi link Whitespace Conceal
|
hi link Whitespace Conceal
|
||||||
hi CursorLine guibg=NONE ctermbg=NONE
|
hi CursorLine guibg=NONE ctermbg=NONE
|
||||||
hi CursorLineNr guibg=NONE ctermbg=NONE
|
hi CursorLineNr guibg=NONE ctermbg=NONE
|
||||||
|
hi Folded guifg=#3b4048 ctermfg=16 guibg=NONE ctermbg=NONE gui=italic cterm=italic
|
||||||
|
|
||||||
" Haskell {{{2
|
" Haskell {{{2
|
||||||
" ------------
|
" ------------
|
||||||
|
@ -333,22 +353,23 @@ nnoremap ;def :call protodef#ReturnSkeletonsFromPrototypesForCurrentBuffer({})<c
|
||||||
|
|
||||||
" ConqueGDB {{{2
|
" ConqueGDB {{{2
|
||||||
" --------------
|
" --------------
|
||||||
let g:ConqueGdb_Leader = ','
|
"let g:ConqueGdb_Leader = ','
|
||||||
" Commented entries are the defaults
|
"" Commented entries are the defaults
|
||||||
"let g:ConqueGdb_Run = g:ConqueGdb_Leader . 'r'
|
""let g:ConqueGdb_Run = g:ConqueGdb_Leader . 'r'
|
||||||
"let g:ConqueGdb_Continue = g:ConqueGdb_Leader . 'c'
|
""let g:ConqueGdb_Continue = g:ConqueGdb_Leader . 'c'
|
||||||
let g:ConqueGdb_Next = g:ConqueGdb_Leader . 'o' " step over
|
"let g:ConqueGdb_Next = g:ConqueGdb_Leader . 'o' " step over
|
||||||
let g:ConqueGdb_Step = g:ConqueGdb_Leader . 'i' " step in
|
"let g:ConqueGdb_Step = g:ConqueGdb_Leader . 'i' " step in
|
||||||
"let g:ConqueGdb_Print = g:ConqueGdb_Leader . 'p'
|
""let g:ConqueGdb_Print = g:ConqueGdb_Leader . 'p'
|
||||||
"let g:ConqueGdb_ToggleBreak = g:ConqueGdb_Leader . 'b'
|
""let g:ConqueGdb_ToggleBreak = g:ConqueGdb_Leader . 'b'
|
||||||
let g:ConqueGdb_Finish = g:ConqueGdb_Leader . 'O' " step out
|
"let g:ConqueGdb_Finish = g:ConqueGdb_Leader . 'O' " step out
|
||||||
"let g:ConqueGdb_Backtrace = g:ConqueGdb_Leader . 't'
|
""let g:ConqueGdb_Backtrace = g:ConqueGdb_Leader . 't'
|
||||||
|
|
||||||
nnoremap <F12> :ConqueGdb --args build/tests --debug
|
"nnoremap <F12> :ConqueGdb --args build/simulation --debug
|
||||||
|
|
||||||
" Vebugger {{{2
|
" Vebugger {{{2
|
||||||
" -------------
|
" -------------
|
||||||
"let g:vebugger_leader='<leader>v'
|
"let g:vebugger_leader='<leader>v'
|
||||||
|
let g:vebugger_leader=','
|
||||||
"
|
"
|
||||||
"nnoremap <F5> :VBGstepOver<cr>
|
"nnoremap <F5> :VBGstepOver<cr>
|
||||||
"nnoremap <F6> :VBGstepIn<cr>
|
"nnoremap <F6> :VBGstepIn<cr>
|
||||||
|
@ -388,14 +409,17 @@ nmap <leader>a <Plug>(EasyAlign)
|
||||||
|
|
||||||
" Wildfire {{{2
|
" Wildfire {{{2
|
||||||
" -------------
|
" -------------
|
||||||
nmap <leader>s <Plug>(wildfire-quick-select)
|
"nmap <leader>s <Plug>(wildfire-quick-select)
|
||||||
let g:wildfire_objects = ["iw", "i'", "i`", 'i"', "i)", "i]", "i}", "ip", "it"]
|
let g:wildfire_objects = ["iw", "i'", "i`", 'i"', "i)", "i]", "i}", "ip", "it"]
|
||||||
|
|
||||||
" YouCompleteMe {{{2
|
" YouCompleteMe {{{2
|
||||||
" ------------------
|
" ------------------
|
||||||
"noremap <leader>g :YcmCompleter GoToImprecise<CR>
|
"noremap <leader>g :YcmCompleter GoToImprecise<CR>
|
||||||
noremap <leader>g <esc>:YcmCompleter GoTo<CR>
|
noremap <leader>gg <esc>:YcmCompleter GoTo<CR>
|
||||||
noremap <M-CR> <esc>:YcmCompleter FixIt<CR>
|
noremap <leader>gi <esc>:YcmCompleter GoToImprecise<CR>
|
||||||
|
noremap <leader>gf <esc>:YcmCompleter FixIt<CR>
|
||||||
|
noremap <leader>st <esc>:YcmCompleter GetType<CR>
|
||||||
|
noremap <leader>si <esc>:YcmCompleter GetTypeImprecise<CR>
|
||||||
|
|
||||||
let g:ycm_enable_diagnostic_highlighting=0
|
let g:ycm_enable_diagnostic_highlighting=0
|
||||||
let g:ycm_complete_in_comments=1
|
let g:ycm_complete_in_comments=1
|
||||||
|
@ -446,6 +470,7 @@ let NERDTreeIgnore=[
|
||||||
\ ".*\\.hi$",
|
\ ".*\\.hi$",
|
||||||
\ ".*\\.pyc$",
|
\ ".*\\.pyc$",
|
||||||
\ ".*\\.bak$",
|
\ ".*\\.bak$",
|
||||||
|
\ ".*\\.ozf$",
|
||||||
\ ".*\\~$"
|
\ ".*\\~$"
|
||||||
\ ]
|
\ ]
|
||||||
|
|
||||||
|
@ -528,6 +553,7 @@ let g:airline#extensions#ale#enabled=1
|
||||||
let g:ale_linters = {
|
let g:ale_linters = {
|
||||||
\ 'c': [],
|
\ 'c': [],
|
||||||
\ 'cpp': [],
|
\ 'cpp': [],
|
||||||
|
\ 'markdown': [],
|
||||||
\}
|
\}
|
||||||
let g:ale_lint_on_text_change='normal'
|
let g:ale_lint_on_text_change='normal'
|
||||||
let g:ale_lint_on_insert_leave=1
|
let g:ale_lint_on_insert_leave=1
|
||||||
|
@ -571,5 +597,11 @@ let g:EditorConfig_core_mode = 'external_command'
|
||||||
" TeTrIs {{{2
|
" TeTrIs {{{2
|
||||||
" -----------
|
" -----------
|
||||||
|
|
||||||
|
" Ledger {{{2
|
||||||
|
" -----------
|
||||||
|
autocmd BufEnter,BufRead *.journal | setlocal modelines=1
|
||||||
|
autocmd BufEnter,BufRead *.journal | inoremap <buffer><silent> !! <esc>:call ledger#entry()<cr>:call CleanLedgerEntry()<cr>
|
||||||
|
autocmd BufEnter,BufRead *.journal | vnoremap <buffer> <tab> <esc>:call NextEntry()<cr>
|
||||||
|
|
||||||
" modeline {{{1
|
" modeline {{{1
|
||||||
" vim: set foldmethod=marker foldlevel=1 et ts=2 sw=2 ft=vim nowrap :
|
" vim: set foldmethod=marker foldlevel=1 noet ft=vim nowrap :
|
||||||
|
|
Loading…
Reference in a new issue