nvim: new plugins and some old configuration from vim
This commit is contained in:
@@ -16,6 +16,8 @@ Plug 'neovim/nvim-lspconfig'
|
||||
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
|
||||
Plug 'wellle/context.vim'
|
||||
Plug 'dbeniamine/cheat.sh-vim'
|
||||
Plug 'puremourning/vimspector'
|
||||
Plug 'derekwyatt/vim-fswitch'
|
||||
" }}}
|
||||
|
||||
" Files switch, jump and grep-like tools {{{
|
||||
@@ -24,6 +26,7 @@ Plug 'junegunn/fzf.vim'
|
||||
Plug 'liuchengxu/vista.vim'
|
||||
Plug 'inside/vim-search-pulse'
|
||||
Plug 'mhinz/vim-startify'
|
||||
Plug 'wellle/targets.vim'
|
||||
" }}}
|
||||
|
||||
" Git integration {{{
|
||||
@@ -33,12 +36,21 @@ Plug 'mhinz/vim-signify' " Mark edited lines - faster gitgutter
|
||||
" Colorschemes {{{
|
||||
Plug 'jaredgorski/spacecamp'
|
||||
Plug 'vim-airline/vim-airline' | Plug 'vim-airline/vim-airline-themes'
|
||||
Plug 'dylanaraps/wal'
|
||||
" }}}
|
||||
|
||||
" Other plugins (external tools, etc) {{{
|
||||
Plug 'junegunn/goyo.vim'
|
||||
Plug 'jez/vim-superman' "vman application
|
||||
Plug 'glacambre/firenvim'
|
||||
Plug 'JMcKiern/vim-shoot'
|
||||
" }}}
|
||||
|
||||
" Filetype syntax {{{
|
||||
Plug 'plasticboy/vim-markdown'
|
||||
Plug 'kergoth/vim-bitbake' " Bitbake templates and syntax
|
||||
Plug 'pboettch/vim-cmake-syntax'
|
||||
Plug 'aklt/plantuml-syntax'
|
||||
" }}}
|
||||
|
||||
call plug#end()
|
||||
@@ -55,32 +67,51 @@ set noshowmode
|
||||
set laststatus=2
|
||||
|
||||
set background=dark
|
||||
colorscheme spacecamp
|
||||
colorscheme wal
|
||||
highlight MatchParen ctermfg=yellow ctermbg=none cterm=NONE
|
||||
set listchars=tab:▸\ ,trail:¬
|
||||
set list
|
||||
hi clear SpellBad
|
||||
hi SpellBad cterm=underline
|
||||
|
||||
|
||||
set tabstop=4
|
||||
set shiftwidth=4
|
||||
set softtabstop=4
|
||||
set expandtab
|
||||
|
||||
set ignorecase
|
||||
set smartcase
|
||||
|
||||
set gdefault
|
||||
|
||||
" space one line, home,end globally increase/decrease
|
||||
nnoremap <Home> zc
|
||||
nnoremap <End> zo
|
||||
|
||||
" TODO define cache dir and conf dir, use them everywhere
|
||||
" Ctags {{{
|
||||
if isdirectory($HOME . '/.vim/tags') == 0
|
||||
:silent !mkdir -p ~/.vim/tags > /dev/null 2>&1
|
||||
if isdirectory($HOME . '/.cache/nvim/tags') == 0
|
||||
:silent !mkdir -p ~/.cache/nvim/tags > /dev/null 2>&1
|
||||
endif
|
||||
let g:gutentags_cache_dir='~/.vim/tags'
|
||||
let g:gutentags_cache_dir='~/.cache/nvim/tags'
|
||||
"let g:gutentags_ctags_extra_args=['--fields=+l']
|
||||
|
||||
if isdirectory($HOME . '/.cache/nvim/undo') == 0
|
||||
:silent !mkdir -p ~/.cache/nvim/undo > /dev/null 2>&1
|
||||
endif
|
||||
set undodir=~/.cache/nvim/undo/
|
||||
set undofile
|
||||
|
||||
let mapleader = "\\"
|
||||
|
||||
inoremap jj <ESC>
|
||||
inoremap jk <ESC>
|
||||
inoremap :w<CR> <Esc>:w<CR>
|
||||
|
||||
" Reselect visual block after incrementing/decrementing
|
||||
vnoremap <c-a> <c-a>gv
|
||||
vnoremap <c-x> <c-x>gv
|
||||
|
||||
nnoremap <leader>2 <esc>:set tabstop=2 softtabstop=2 shiftwidth=2<cr>
|
||||
nnoremap <leader>4 <esc>:set tabstop=4 softtabstop=4 shiftwidth=4<cr>
|
||||
nnoremap <leader>8 <esc>:set tabstop=8 softtabstop=8 shiftwidth=8<cr>
|
||||
@@ -129,34 +160,18 @@ set colorcolumn=80
|
||||
nnoremap <leader>t :NERDTreeToggle<CR>
|
||||
let NERDTreeIgnore=['\.vim$', '\~$', '\.pyc$']
|
||||
|
||||
nnoremap <leader>ff :FZF!<CR>
|
||||
nnoremap <leader>fl :Lines!<CR>
|
||||
nnoremap <leader>fb :Buffers<CR>
|
||||
inoremap <leader>fs <ESC>:Snippets!<CR>
|
||||
nnoremap <leader>fa :Rg! <C-R><C-W><CR>
|
||||
nnoremap <leader>f :FZF!<CR>
|
||||
nnoremap <leader>l :Lines!<CR>
|
||||
nnoremap <leader>b :Buffers<CR>
|
||||
inoremap <leader>s <ESC>:Snippets!<CR>
|
||||
nnoremap <leader>a :Rg! <C-R><C-W><CR>
|
||||
|
||||
" Disable context.vim on json files
|
||||
let g:context_filetype_blacklist = ["json"]
|
||||
|
||||
match Error /\s\+$\|DU\cPA/
|
||||
|
||||
function! FindAlternate()
|
||||
let l:ext = 'h'
|
||||
let l:curr_ext = expand('%:e')
|
||||
if (l:curr_ext == 'c')
|
||||
let l:ext = 'h'
|
||||
elseif (l:curr_ext == 'cpp')
|
||||
let l:ext = 'h'
|
||||
elseif (l:curr_ext == 'h')
|
||||
let l:ext = 'c'
|
||||
elseif (l:curr_ext == 'hpp')
|
||||
let l:ext = 'cpp'
|
||||
endif
|
||||
let l:file = expand('%:t:r') . '.' . l:ext
|
||||
:exec 'find ' . l:file
|
||||
endfunction
|
||||
|
||||
nnoremap <F6> :call FindAlternate()<CR>
|
||||
nnoremap <F6> :silent FSHere<CR>
|
||||
|
||||
setglobal virtualedit=block
|
||||
setglobal shiftround
|
||||
|
||||
Reference in New Issue
Block a user