Vim: folding + coc.nvim usage
This commit is contained in:
385
.vimrc
385
.vimrc
@@ -1,12 +1,18 @@
|
|||||||
" Basic configuration
|
" vim:foldmethod=marker:foldlevel=0
|
||||||
|
|
||||||
|
" Basic configuration {{{
|
||||||
|
|
||||||
if &compatible
|
if &compatible
|
||||||
set nocompatible " Be iMproved
|
set nocompatible
|
||||||
set modelines=0
|
set modelines=1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" }}}
|
||||||
|
|
||||||
|
" Plugins {{{
|
||||||
|
|
||||||
filetype plugin off
|
filetype plugin off
|
||||||
filetype off " required
|
filetype off " required
|
||||||
|
|
||||||
" set the runtime path to include Vundle and initialize
|
" set the runtime path to include Vundle and initialize
|
||||||
set runtimepath+=~/.vim/bundle/Vundle.vim
|
set runtimepath+=~/.vim/bundle/Vundle.vim
|
||||||
call vundle#begin()
|
call vundle#begin()
|
||||||
@@ -14,7 +20,7 @@ call vundle#begin()
|
|||||||
" let Vundle manage Vundle, required
|
" let Vundle manage Vundle, required
|
||||||
Plugin 'VundleVim/Vundle.vim'
|
Plugin 'VundleVim/Vundle.vim'
|
||||||
|
|
||||||
" Completion engines:
|
" Completion engines {{{
|
||||||
"Plugin 'Valloric/YouCompleteMe'
|
"Plugin 'Valloric/YouCompleteMe'
|
||||||
"Plugin 'zxqfl/tabnine-vim'
|
"Plugin 'zxqfl/tabnine-vim'
|
||||||
"Plugin 'lifepillar/vim-mucomplete'
|
"Plugin 'lifepillar/vim-mucomplete'
|
||||||
@@ -22,19 +28,22 @@ Plugin 'VundleVim/Vundle.vim'
|
|||||||
"Plugin 'lyuts/vim-rtags'
|
"Plugin 'lyuts/vim-rtags'
|
||||||
"Plugin 'JBakamovic/cxxd-vim'
|
"Plugin 'JBakamovic/cxxd-vim'
|
||||||
Plugin 'neoclide/coc.nvim'
|
Plugin 'neoclide/coc.nvim'
|
||||||
|
" }}}
|
||||||
|
|
||||||
" Mappings
|
" Mappings {{{
|
||||||
"Plugin 'milkypostman/vim-togglelist' " Map of quickfix toggles
|
"Plugin 'milkypostman/vim-togglelist' " Map of quickfix toggles
|
||||||
|
" }}}
|
||||||
|
|
||||||
" Code development helpers
|
" Code development helpers {{{
|
||||||
"Plugin 'rhysd/vim-clang-format'
|
"Plugin 'rhysd/vim-clang-format'
|
||||||
"Plugin 'quark-zju/vim-cpp-auto-include'
|
"Plugin 'quark-zju/vim-cpp-auto-include'
|
||||||
Plugin 'tpope/vim-commentary' " Toggle C style comments with gc
|
Plugin 'tpope/vim-commentary' " Toggle C style comments with gc
|
||||||
"Plugin 'mnpk/vim-jira-complete'
|
"Plugin 'mnpk/vim-jira-complete'
|
||||||
"Plugin 'KabbAmine/zeavim.vim' " gz to open zeal
|
"Plugin 'KabbAmine/zeavim.vim' " gz to open zeal
|
||||||
Plugin 'mbbill/undotree'
|
Plugin 'mbbill/undotree'
|
||||||
|
" }}}
|
||||||
|
|
||||||
" Files switch, jump and grep-like tools
|
" Files switch, jump and grep-like tools {{{
|
||||||
"Plugin 'ericcurtin/CurtineIncSw.vim' "Toggle .c .h files
|
"Plugin 'ericcurtin/CurtineIncSw.vim' "Toggle .c .h files
|
||||||
"Plugin 'vim-scripts/a.vim' Curtine is the new a.vim
|
"Plugin 'vim-scripts/a.vim' Curtine is the new a.vim
|
||||||
"Plugin 'scrooloose/nerdtree'
|
"Plugin 'scrooloose/nerdtree'
|
||||||
@@ -42,33 +51,37 @@ Plugin 'mileszs/ack.vim' " Ack integration
|
|||||||
"Plugin 'jremmen/vim-ripgrep'
|
"Plugin 'jremmen/vim-ripgrep'
|
||||||
Plugin 'ctrlpvim/ctrlp.vim'
|
Plugin 'ctrlpvim/ctrlp.vim'
|
||||||
"Plugin 'junegunn/fzf.vim'
|
"Plugin 'junegunn/fzf.vim'
|
||||||
"Plugin 'fholgado/minibufexpl.vim
|
Plugin 'fholgado/minibufexpl.vim'
|
||||||
Plugin 'justinmk/vim-sneak' " easy movement
|
Plugin 'justinmk/vim-sneak' " easy movement
|
||||||
"Plugin 'easymotion/vim-easymotion'
|
"Plugin 'easymotion/vim-easymotion'
|
||||||
Plugin 'ludovicchabant/vim-gutentags' "Auto generate tags
|
Plugin 'ludovicchabant/vim-gutentags' "Auto generate tags
|
||||||
"Plugin 'andymass/vim-matchup' " Improve if-else matches
|
"Plugin 'andymass/vim-matchup' " Improve if-else matches
|
||||||
Plugin 'vim-scripts/taglist.vim'
|
Plugin 'vim-scripts/taglist.vim'
|
||||||
|
" }}}
|
||||||
|
|
||||||
" Git integration
|
" Git integration {{{
|
||||||
"Plugin 'airblade/vim-gitgutter' " Mark edited lines
|
"Plugin 'airblade/vim-gitgutter' " Mark edited lines
|
||||||
Plugin 'mhinz/vim-signify' " Mark edited lines - faster gitgutter
|
Plugin 'mhinz/vim-signify' " Mark edited lines - faster gitgutter
|
||||||
"Plugin 'rhysd/git-messenger.vim' " show git history
|
"Plugin 'rhysd/git-messenger.vim' " show git history
|
||||||
"Plugin 'tpope/vim-fugitive' " Git integration
|
"Plugin 'tpope/vim-fugitive' " Git integration
|
||||||
|
" }}}
|
||||||
|
|
||||||
" Syntax for random filetypes
|
" Syntax for random filetypes {{{
|
||||||
"Plugin 'gabrielelana/vim-markdown'
|
"Plugin 'gabrielelana/vim-markdown'
|
||||||
Plugin 'kergoth/vim-bitbake' " Bitbake templates and syntax
|
Plugin 'kergoth/vim-bitbake' " Bitbake templates and syntax
|
||||||
"Plugin 'vim-scripts/DoxygenToolkit.vim' " Doxygen support
|
"Plugin 'vim-scripts/DoxygenToolkit.vim' " Doxygen support
|
||||||
Plugin 'pboettch/vim-cmake-syntax'
|
Plugin 'pboettch/vim-cmake-syntax'
|
||||||
|
" }}}
|
||||||
|
|
||||||
" Colorschemes
|
" Colorschemes {{{
|
||||||
Plugin 'flazz/vim-colorschemes' " lots of colorschemes
|
Plugin 'flazz/vim-colorschemes' " lots of colorschemes
|
||||||
"Plugin 'octol/vim-cpp-enhanced-highlight'
|
"Plugin 'octol/vim-cpp-enhanced-highlight'
|
||||||
"Plugin 'vim-scripts/CycleColor'
|
"Plugin 'vim-scripts/CycleColor'
|
||||||
"Plugin 'jeaye/color_coded'
|
"Plugin 'jeaye/color_coded'
|
||||||
"Plugin 'thiagoalessio/rainbow_levels.vim'
|
"Plugin 'thiagoalessio/rainbow_levels.vim'
|
||||||
|
" }}}
|
||||||
|
|
||||||
" Other plugins (external tools, etc)
|
" Other plugins (external tools, etc) {{{
|
||||||
"Plugin 'Shougo/vimproc.vim'
|
"Plugin 'Shougo/vimproc.vim'
|
||||||
Plugin 'junegunn/goyo.vim'
|
Plugin 'junegunn/goyo.vim'
|
||||||
Plugin 'jez/vim-superman' "vman application
|
Plugin 'jez/vim-superman' "vman application
|
||||||
@@ -77,31 +90,40 @@ Plugin 'vimwiki/vimwiki'
|
|||||||
"Plugin 'pelodelfuego/vim-swoop' " editing in parallel
|
"Plugin 'pelodelfuego/vim-swoop' " editing in parallel
|
||||||
"Plugin 'vim-airline/vim-airline'
|
"Plugin 'vim-airline/vim-airline'
|
||||||
Plugin 'mhinz/vim-startify'
|
Plugin 'mhinz/vim-startify'
|
||||||
|
" }}}
|
||||||
|
|
||||||
call vundle#end() " required
|
call vundle#end() " required
|
||||||
|
|
||||||
" ========== Vim Basic Settings ============="
|
|
||||||
|
|
||||||
filetype plugin indent on
|
filetype plugin indent on
|
||||||
|
|
||||||
"TAB settings.
|
" }}}
|
||||||
|
|
||||||
|
"TAB settings {{{
|
||||||
|
|
||||||
set tabstop=4
|
set tabstop=4
|
||||||
set shiftwidth=4
|
set shiftwidth=4
|
||||||
set softtabstop=4
|
set softtabstop=4
|
||||||
|
|
||||||
set expandtab
|
set expandtab
|
||||||
|
|
||||||
" More Common Settings.
|
" }}}
|
||||||
|
|
||||||
|
" More Common Settings {{{
|
||||||
|
|
||||||
set encoding=utf-8
|
set encoding=utf-8
|
||||||
set scrolloff=10
|
set scrolloff=10
|
||||||
set autoindent
|
set autoindent
|
||||||
set cino=l1,:0
|
set cino=l1,:0
|
||||||
set showmode
|
set showmode
|
||||||
set showcmd
|
set showcmd
|
||||||
|
" do not force write on buffer switch
|
||||||
set hidden
|
set hidden
|
||||||
"set visualbell
|
"set visualbell
|
||||||
set nowrapscan
|
set nowrapscan
|
||||||
|
|
||||||
|
" }}}
|
||||||
|
|
||||||
|
" Vim draw options {{{
|
||||||
|
|
||||||
set cursorline
|
set cursorline
|
||||||
set ttyfast
|
set ttyfast
|
||||||
set lazyredraw
|
set lazyredraw
|
||||||
@@ -109,14 +131,33 @@ set ruler
|
|||||||
set backspace=eol,indent,start
|
set backspace=eol,indent,start
|
||||||
set statusline=%<%f%h%m%r%=%b\ 0x%B\ \ %l,%c%V\ %P
|
set statusline=%<%f%h%m%r%=%b\ 0x%B\ \ %l,%c%V\ %P
|
||||||
set laststatus=2
|
set laststatus=2
|
||||||
|
|
||||||
"set relativenumber
|
|
||||||
set number
|
set number
|
||||||
set norelativenumber
|
set norelativenumber
|
||||||
|
" Make Vim to handle long lines nicely.
|
||||||
|
set wrap
|
||||||
|
set textwidth=79
|
||||||
|
set formatoptions=cqrnb1j
|
||||||
|
|
||||||
|
syntax on
|
||||||
|
|
||||||
|
set showmatch
|
||||||
|
"set matchtime=3
|
||||||
|
"Control it with %/s///i - ignore and I - sens
|
||||||
|
"set ignorecase
|
||||||
|
set smartcase
|
||||||
|
" %s///g not needed
|
||||||
|
set gdefault
|
||||||
|
set hlsearch
|
||||||
|
set incsearch
|
||||||
|
nnoremap <leader><space> :nohlsearch<cr>
|
||||||
|
|
||||||
|
" }}}
|
||||||
|
|
||||||
set shell=/usr/local/bin/fish
|
set shell=/usr/local/bin/fish
|
||||||
set path+=**
|
set path+=**
|
||||||
|
|
||||||
|
" Undofile {{{
|
||||||
|
|
||||||
if exists("+undofile")
|
if exists("+undofile")
|
||||||
if isdirectory($HOME . '/.vim/undo') == 0
|
if isdirectory($HOME . '/.vim/undo') == 0
|
||||||
:silent !mkdir -p ~/.vim/undo > /dev/null 2>&1
|
:silent !mkdir -p ~/.vim/undo > /dev/null 2>&1
|
||||||
@@ -125,36 +166,23 @@ if exists("+undofile")
|
|||||||
set undofile
|
set undofile
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" }}}
|
||||||
|
|
||||||
|
" Ctags {{{
|
||||||
if isdirectory($HOME . '/.vim/tags') == 0
|
if isdirectory($HOME . '/.vim/tags') == 0
|
||||||
:silent !mkdir -p ~/.vim/tags > /dev/null 2>&1
|
:silent !mkdir -p ~/.vim/tags > /dev/null 2>&1
|
||||||
endif
|
endif
|
||||||
let g:gutentags_cache_dir='~/.vim/tags'
|
let g:gutentags_cache_dir='~/.vim/tags'
|
||||||
"let g:gutentags_ctags_extra_args=['--fields=+l']
|
"let g:gutentags_ctags_extra_args=['--fields=+l']
|
||||||
|
|
||||||
|
" }}}
|
||||||
|
|
||||||
"Changing Leader Key
|
"Changing Leader Key
|
||||||
let mapleader = "\\"
|
let mapleader = "\\"
|
||||||
|
|
||||||
" Make pasting done without any indentation break
|
" Make pasting done without any indentation break
|
||||||
set pastetoggle=<F3>
|
set pastetoggle=<F3>
|
||||||
|
|
||||||
syntax on
|
|
||||||
|
|
||||||
"Control it with %/s///i - ignore and I - sens
|
|
||||||
"set ignorecase
|
|
||||||
set smartcase
|
|
||||||
" %s///g not needed
|
|
||||||
set gdefault
|
|
||||||
set incsearch
|
|
||||||
set showmatch
|
|
||||||
"set matchtime=3
|
|
||||||
set hlsearch
|
|
||||||
nnoremap <leader><space> :noh<cr>
|
|
||||||
|
|
||||||
" Make Vim to handle long lines nicely.
|
|
||||||
set wrap
|
|
||||||
set textwidth=79
|
|
||||||
set formatoptions=cqrnb1j
|
|
||||||
|
|
||||||
nnoremap j gj
|
nnoremap j gj
|
||||||
nnoremap k gk
|
nnoremap k gk
|
||||||
|
|
||||||
@@ -179,9 +207,6 @@ vnoremap <c-x> <c-x>gv
|
|||||||
" Re-hardwrap Paragraph
|
" Re-hardwrap Paragraph
|
||||||
nnoremap <leader>q gqip
|
nnoremap <leader>q gqip
|
||||||
|
|
||||||
" leader v Select just pasted text
|
|
||||||
"nnoremap <leader>v V`]
|
|
||||||
|
|
||||||
" jj For Quicker Escaping between normal and editing mode
|
" jj For Quicker Escaping between normal and editing mode
|
||||||
inoremap jj <ESC>
|
inoremap jj <ESC>
|
||||||
inoremap jk <ESC>
|
inoremap jk <ESC>
|
||||||
@@ -207,16 +232,7 @@ set wildignore+=*.orig "Merge resolution files"
|
|||||||
match Error /\s\+$\|DU\cPA/
|
match Error /\s\+$\|DU\cPA/
|
||||||
|
|
||||||
" Removing scrollbars
|
" Removing scrollbars
|
||||||
if has("gui_running")
|
if !has("gui_running")
|
||||||
set guitablabel=%-0.12t%M
|
|
||||||
set guioptions-=T
|
|
||||||
set guioptions-=r
|
|
||||||
set guioptions-=L
|
|
||||||
set guioptions+=a
|
|
||||||
set guioptions-=m
|
|
||||||
colorscheme alduin
|
|
||||||
set listchars=tab:▸\ ,eol:¬ " Invisibles using the Textmate style
|
|
||||||
else
|
|
||||||
colorscheme badwolf
|
colorscheme badwolf
|
||||||
set background=dark
|
set background=dark
|
||||||
" To show special characters in Vim
|
" To show special characters in Vim
|
||||||
@@ -224,23 +240,21 @@ else
|
|||||||
set list
|
set list
|
||||||
hi clear SpellBad
|
hi clear SpellBad
|
||||||
hi SpellBad cterm=underline
|
hi SpellBad cterm=underline
|
||||||
hi Normal ctermbg=None
|
"hi Normal ctermbg=None
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if &term =~ '256color'
|
if &term =~ '256color'
|
||||||
" Disable Background Color Erase (BCE) so that color schemes
|
" Disable Background Color Erase (BCE) so that color schemes
|
||||||
" work properly when Vim is used inside tmux and GNU screen.
|
" work properly when Vim is used inside tmux and GNU screen.
|
||||||
set t_ut=
|
" set t_ut=
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" ========== Plugin Settings =========="
|
|
||||||
|
|
||||||
" Mini Buffer some settigns."
|
" Mini Buffer some settigns."
|
||||||
"let g:miniBufExplMapWindowNavVim = 1
|
let g:miniBufExplMapWindowNavVim = 1
|
||||||
"let g:miniBufExplMapWindowNavArrows = 1
|
let g:miniBufExplMapWindowNavArrows = 1
|
||||||
"let g:miniBufExplMapCTabSwitchBufs = 1
|
let g:miniBufExplMapCTabSwitchBufs = 1
|
||||||
"let g:miniBufExplModSelTarget = 1
|
let g:miniBufExplModSelTarget = 1
|
||||||
"let g:miniBufExplStatusLineText = ''
|
let g:miniBufExplStatusLineText = ''
|
||||||
|
|
||||||
" Tagbar key bindings."
|
" Tagbar key bindings."
|
||||||
"nmap <leader>t :TlistToggle<cr>
|
"nmap <leader>t :TlistToggle<cr>
|
||||||
@@ -274,93 +288,29 @@ endif
|
|||||||
"hi! link RainbowLevel6 Identifier
|
"hi! link RainbowLevel6 Identifier
|
||||||
"hi! link RainbowLevel7 Normal
|
"hi! link RainbowLevel7 Normal
|
||||||
"hi! link RainbowLevel8 Comment
|
"hi! link RainbowLevel8 Comment
|
||||||
"
|
|
||||||
if has("cscope")
|
|
||||||
"use both cscope and ctags
|
|
||||||
"set cscopetag
|
|
||||||
|
|
||||||
" change this to 1 to search ctags DBs first
|
"nnoremap yg :YcmCompleter GoTo<CR>
|
||||||
set csto=0
|
"nnoremap yf :YcmCompleter FixIt<CR>
|
||||||
set cst
|
"nnoremap yd :YcmCompleter GetDoc<CR>
|
||||||
set nocsverb
|
"nnoremap yt :YcmCompleter GetType<CR>
|
||||||
" add any database in current directory
|
"nnoremap yp :YcmCompleter GetParent<CR>
|
||||||
if filereadable("cscope.out")
|
"let g:ycm_confirm_extra_conf = 0
|
||||||
cs add cscope.out
|
"let g:ycm_warning_symbol = '>'
|
||||||
" else add database pointed to by environment
|
"let g:ycm_complete_in_strings = 0
|
||||||
elseif $CSCOPE_DB != ""
|
"let g:ycm_collect_identifiers_from_tags_files = 1
|
||||||
cs add $CSCOPE_DB
|
"let g:ycm_enable_diagnostic_highlighting = 0
|
||||||
endif
|
"let g:ycm_autoclose_preview_window_after_completion = 0
|
||||||
|
"let g:ycm_autoclose_preview_window_after_insertion = 1
|
||||||
" 's' symbol: find all references to the token under cursor
|
"let g:ycm_min_num_of_chars_for_completion = 99
|
||||||
" 'g' global: find global definition(s) of the token under cursor
|
|
||||||
" 'c' calls: find all calls to the function name under cursor
|
|
||||||
" 't' text: find all instances of the text under cursor
|
|
||||||
" 'e' egrep: egrep search for the word under cursor
|
|
||||||
" 'f' file: open the filename under cursor
|
|
||||||
" 'i' includes: find files that include the filename under cursor
|
|
||||||
" 'd' called: find functions that function under cursor calls
|
|
||||||
|
|
||||||
" Using 'CTRL-\' then a search type makes the vim window
|
|
||||||
" "shell-out", with search results displayed on the bottom
|
|
||||||
|
|
||||||
nmap <C-\>s :cs find s <C-R>=expand("<cword>")<CR><CR>
|
|
||||||
nmap <C-\>g :cs find g <C-R>=expand("<cword>")<CR><CR>
|
|
||||||
nmap <C-\>c :cs find c <C-R>=expand("<cword>")<CR><CR>
|
|
||||||
nmap <C-\>t :cs find t <C-R>=expand("<cword>")<CR><CR>
|
|
||||||
nmap <C-\>e :cs find e <C-R>=expand("<cword>")<CR><CR>
|
|
||||||
nmap <C-\>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
|
|
||||||
nmap <C-\>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
|
|
||||||
nmap <C-\>d :cs find d <C-R>=expand("<cword>")<CR><CR>
|
|
||||||
|
|
||||||
"" Using 'CTRL-spacebar' then a search type makes the vim window
|
|
||||||
"" split horizontally, with search result displayed in
|
|
||||||
"" the new window.
|
|
||||||
|
|
||||||
" nmap <C-[>s :scs find s <C-R>=expand("<cword>")<CR><CR>
|
|
||||||
" nmap <C-[>g :scs find g <C-R>=expand("<cword>")<CR><CR>
|
|
||||||
" nmap <C-[>c :scs find c <C-R>=expand("<cword>")<CR><CR>
|
|
||||||
" nmap <C-[>t :scs find t <C-R>=expand("<cword>")<CR><CR>
|
|
||||||
" nmap <C-[>e :scs find e <C-R>=expand("<cword>")<CR><CR>
|
|
||||||
" nmap <C-[>f :scs find f <C-R>=expand("<cfile>")<CR><CR>
|
|
||||||
" nmap <C-[>i :scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
|
|
||||||
" nmap <C-[>d :scs find d <C-R>=expand("<cword>")<CR><CR>
|
|
||||||
|
|
||||||
"" Hitting CTRL-space *twice* before the search type does a vertical
|
|
||||||
"" split instead of a horizontal one
|
|
||||||
|
|
||||||
" nmap <C-[><C-[>s :vert scs find s <C-R>=expand("<cword>")<CR><CR>
|
|
||||||
" nmap <C-[><C-[>g :vert scs find g <C-R>=expand("<cword>")<CR><CR>
|
|
||||||
" nmap <C-[><C-[>c :vert scs find c <C-R>=expand("<cword>")<CR><CR>
|
|
||||||
" nmap <C-[><C-[>t :vert scs find t <C-R>=expand("<cword>")<CR><CR>
|
|
||||||
" nmap <C-[><C-[>e :vert scs find e <C-R>=expand("<cword>")<CR><CR>
|
|
||||||
" nmap <C-[><C-[>i :vert scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
|
|
||||||
" nmap <C-[><C-[>d :vert scs find d <C-R>=expand("<cword>")<CR><CR>
|
|
||||||
endif
|
|
||||||
|
|
||||||
nnoremap yg :YcmCompleter GoTo<CR>
|
|
||||||
nnoremap yf :YcmCompleter FixIt<CR>
|
|
||||||
nnoremap yd :YcmCompleter GetDoc<CR>
|
|
||||||
nnoremap yt :YcmCompleter GetType<CR>
|
|
||||||
nnoremap yp :YcmCompleter GetParent<CR>
|
|
||||||
let g:ycm_confirm_extra_conf = 0
|
|
||||||
let g:ycm_warning_symbol = '>'
|
|
||||||
let g:ycm_complete_in_strings = 0
|
|
||||||
"let g:ycm_server_log_level = 'debug'
|
|
||||||
"let g:ycm_server_use_vim_stdout = 1
|
|
||||||
let g:ycm_collect_identifiers_from_tags_files = 1
|
|
||||||
let g:ycm_enable_diagnostic_highlighting = 0
|
|
||||||
let g:ycm_autoclose_preview_window_after_completion = 0
|
|
||||||
let g:ycm_autoclose_preview_window_after_insertion = 1
|
|
||||||
let g:ycm_min_num_of_chars_for_completion = 99
|
|
||||||
|
|
||||||
map <F12> :colorscheme random<CR>
|
map <F12> :colorscheme random<CR>
|
||||||
|
|
||||||
|
" Folding {{{
|
||||||
function! FoldFormat()
|
function! FoldFormat()
|
||||||
let foldsize = (v:foldend - v:foldstart)
|
let foldsize = (v:foldend - v:foldstart)
|
||||||
return getline(v:foldstart)."\t\t\t(".foldsize."\tmore lines)"
|
return getline(v:foldstart)."\t\t\t(".foldsize."\tmore lines)"
|
||||||
endfunction
|
endfunction
|
||||||
|
" space one line, home,end globally increase/decrease
|
||||||
" Folding - space one line, home,end globally increase/decrease
|
|
||||||
set foldenable
|
set foldenable
|
||||||
set foldlevelstart=999
|
set foldlevelstart=999
|
||||||
set foldnestmax=5
|
set foldnestmax=5
|
||||||
@@ -370,16 +320,10 @@ set foldmethod=syntax
|
|||||||
nnoremap <space> za
|
nnoremap <space> za
|
||||||
nnoremap <Home> zm
|
nnoremap <Home> zm
|
||||||
nnoremap <End> zr
|
nnoremap <End> zr
|
||||||
|
" }}}
|
||||||
|
|
||||||
nnoremap <leader>s :mksession!<CR>
|
nnoremap <leader>s :mksession!<CR>
|
||||||
|
|
||||||
" Jira config
|
|
||||||
let b:jiracomplete_url = 'http://192.168.1.49:8080/jira'
|
|
||||||
let b:jiracomplete_username = 'r.kmiec'
|
|
||||||
let b:jiracomplete_password = 'password'
|
|
||||||
" We can also use v:val.menu
|
|
||||||
let b:jiracomplete_format = '"[". v:val.abbr. "]"'
|
|
||||||
|
|
||||||
set updatetime=100
|
set updatetime=100
|
||||||
|
|
||||||
" From C.vim:
|
" From C.vim:
|
||||||
@@ -398,29 +342,24 @@ inoremap :w<CR> <Esc>:w<CR>i
|
|||||||
" ctrlp configuration
|
" ctrlp configuration
|
||||||
let g:ctrlp_map = '<c-p>'
|
let g:ctrlp_map = '<c-p>'
|
||||||
let g:ctrlp_cmd = 'CtrlPLastMode'
|
let g:ctrlp_cmd = 'CtrlPLastMode'
|
||||||
let g:ctrlp_user_command = 'ack --cpp --cc -f %s'
|
let g:ctrlp_user_command = 'ack --cpp --cc --hh --hpp -f %s'
|
||||||
let g:ctrlp_working_path_mode = 'rw'
|
let g:ctrlp_working_path_mode = 'rw'
|
||||||
|
|
||||||
tnoremap <Esc> <C-W><C-W>
|
tnoremap <Esc> <C-W><C-W>
|
||||||
|
|
||||||
set nospell
|
set nospell
|
||||||
set runtimepath+=/usr/share/vim/vimfiles
|
set runtimepath+=/usr/share/vim/vimfiles
|
||||||
set spelllang=en,pl
|
set spelllang=en
|
||||||
" Dictionary path, from which the words are being looked up.
|
" Dictionary path, from which the words are being looked up.
|
||||||
set dictionary+=/usr/share/dict/words
|
set dictionary+=/usr/share/dict/words
|
||||||
|
|
||||||
" from vimconfig.com
|
" from vimconfig.com
|
||||||
"set showbreak=++
|
|
||||||
|
|
||||||
"let g:rtagsRcCmd='rtags-rc'
|
"let g:rtagsRcCmd='rtags-rc'
|
||||||
"set timeoutlen=1000
|
|
||||||
"set ttimeout
|
|
||||||
"set ttimeoutlen=0
|
|
||||||
"let g:matchparen_timeout = 2
|
"let g:matchparen_timeout = 2
|
||||||
"let g:matchparen_insert_timeout = 2
|
"let g:matchparen_insert_timeout = 2
|
||||||
|
|
||||||
" Mapping to NERDTree
|
" Mapping to NERDTree
|
||||||
"nnoremap <C-n> :NERDTreeToggle<cr>
|
nnoremap <C-n> :e .<CR>
|
||||||
"let NERDTreeIgnore=['\.vim$', '\~$', '\.pyc$']
|
"let NERDTreeIgnore=['\.vim$', '\~$', '\.pyc$']
|
||||||
let g:netrw_banner=0
|
let g:netrw_banner=0
|
||||||
let g:netrw_wisize=20
|
let g:netrw_wisize=20
|
||||||
@@ -430,23 +369,23 @@ nnoremap <leader>n :Lexplore<CR>
|
|||||||
|
|
||||||
" taken from Damian Conway
|
" taken from Damian Conway
|
||||||
|
|
||||||
nnoremap <silent> n n:call HLNext(0.2)<cr>
|
"nnoremap <silent> n n:call HLNext(0.2)<cr>
|
||||||
nnoremap <silent> N N:call HLNext(0.2)<cr>
|
"nnoremap <silent> N N:call HLNext(0.2)<cr>
|
||||||
|
"
|
||||||
function! HLNext(blinktime)
|
"function! HLNext(blinktime)
|
||||||
let [bufnum, lnum, col, off] = getpos('.')
|
" let [bufnum, lnum, col, off] = getpos('.')
|
||||||
let matchlen = strlen(matchstr(strpart(getline('.'), col - 1), @/))
|
" let matchlen = strlen(matchstr(strpart(getline('.'), col - 1), @/))
|
||||||
let target_pat = '\c\%#'.@/
|
" let target_pat = '\c\%#'.@/
|
||||||
let blinks = 1
|
" let blinks = 1
|
||||||
for n in range(1, blinks)
|
" for n in range(1, blinks)
|
||||||
let red = matchadd('WarningMsg', target_pat, 101)
|
" let red = matchadd('WarningMsg', target_pat, 101)
|
||||||
redraw
|
" redraw
|
||||||
exec 'sleep ' . float2nr(a:blinktime / (2*blinks) * 1000) . 'm'
|
" exec 'sleep ' . float2nr(a:blinktime / (2*blinks) * 1000) . 'm'
|
||||||
call matchdelete(red)
|
" call matchdelete(red)
|
||||||
redraw
|
" redraw
|
||||||
exec 'sleep ' . float2nr(a:blinktime / (2*blinks) * 1000) . 'm'
|
" exec 'sleep ' . float2nr(a:blinktime / (2*blinks) * 1000) . 'm'
|
||||||
endfor
|
" endfor
|
||||||
endfunction
|
"endfunction
|
||||||
|
|
||||||
nnoremap S :%s//g<LEFT><LEFT>
|
nnoremap S :%s//g<LEFT><LEFT>
|
||||||
xnoremap S :s//g<LEFT><LEFT>
|
xnoremap S :s//g<LEFT><LEFT>
|
||||||
@@ -485,55 +424,55 @@ packadd termdebug
|
|||||||
|
|
||||||
let g:startify_custom_header = ''
|
let g:startify_custom_header = ''
|
||||||
|
|
||||||
"set shortmess+=c
|
set shortmess+=c
|
||||||
"inoremap <silent><expr> <c-space> coc#refresh()
|
inoremap <silent><expr> <c-space> coc#refresh()
|
||||||
"set signcolumn=yes
|
set signcolumn=yes
|
||||||
"set cmdheight=2
|
set cmdheight=2
|
||||||
"inoremap <silent><expr> <TAB>
|
inoremap <silent><expr> <TAB>
|
||||||
" \ pumvisible() ? "\<C-n>" :
|
\ pumvisible() ? "\<C-n>" :
|
||||||
" \ <SID>check_back_space() ? "\<TAB>" :
|
\ <SID>check_back_space() ? "\<TAB>" :
|
||||||
" \ coc#refresh()
|
\ coc#refresh()
|
||||||
"inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
|
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
|
||||||
"
|
|
||||||
"function! s:check_back_space() abort
|
function! s:check_back_space() abort
|
||||||
" let col = col('.') - 1
|
let col = col('.') - 1
|
||||||
" return !col || getline('.')[col - 1] =~# '\s'
|
return !col || getline('.')[col - 1] =~# '\s'
|
||||||
"endfunction
|
endfunction
|
||||||
"
|
|
||||||
"inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
|
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
|
||||||
"
|
|
||||||
"nmap <silent> gd <Plug>(coc-definition)
|
nmap <silent> gd <Plug>(coc-definition)
|
||||||
"nmap <silent> gy <Plug>(coc-type-definition)
|
nmap <silent> gy <Plug>(coc-type-definition)
|
||||||
"nmap <silent> gi <Plug>(coc-implementation)
|
nmap <silent> gi <Plug>(coc-implementation)
|
||||||
"nmap <silent> gr <Plug>(coc-references)
|
nmap <silent> gr <Plug>(coc-references)
|
||||||
"
|
|
||||||
"nnoremap <silent> K :call <SID>show_documentation()<CR>
|
nnoremap <silent> K :call <SID>show_documentation()<CR>
|
||||||
"
|
|
||||||
"function! s:show_documentation()
|
function! s:show_documentation()
|
||||||
" if (index(['vim','help'], &filetype) >= 0)
|
if (index(['vim','help'], &filetype) >= 0)
|
||||||
" execute 'h '.expand('<cword>')
|
execute 'h '.expand('<cword>')
|
||||||
" else
|
else
|
||||||
" call CocAction('doHover')
|
call CocAction('doHover')
|
||||||
" endif
|
endif
|
||||||
"endfunction
|
endfunction
|
||||||
"
|
|
||||||
"autocmd CursorHold * silent call CocActionAsync('highlight')
|
autocmd CursorHold * silent call CocActionAsync('highlight')
|
||||||
"xmap <leader>f <Plug>(coc-format-selected)
|
xmap <leader>f <Plug>(coc-format-selected)
|
||||||
"nmap <leader>f <Plug>(coc-format-selected)
|
nmap <leader>f <Plug>(coc-format-selected)
|
||||||
"
|
|
||||||
"" Show all diagnostics
|
" Show all diagnostics
|
||||||
"nnoremap <silent> <space>a :<C-u>CocList diagnostics<cr>
|
nnoremap <silent> <space>a :<C-u>CocList diagnostics<cr>
|
||||||
"" Manage extensions
|
" Manage extensions
|
||||||
"nnoremap <silent> <space>e :<C-u>CocList extensions<cr>
|
nnoremap <silent> <space>e :<C-u>CocList extensions<cr>
|
||||||
"" Show commands
|
" Show commands
|
||||||
"nnoremap <silent> <space>c :<C-u>CocList commands<cr>
|
nnoremap <silent> <space>c :<C-u>CocList commands<cr>
|
||||||
"" Find symbol of current document
|
" Find symbol of current document
|
||||||
"nnoremap <silent> <space>o :<C-u>CocList outline<cr>
|
nnoremap <silent> <space>o :<C-u>CocList outline<cr>
|
||||||
"" Search workspace symbols
|
" Search workspace symbols
|
||||||
"nnoremap <silent> <space>s :<C-u>CocList -I symbols<cr>
|
nnoremap <silent> <space>s :<C-u>CocList -I symbols<cr>
|
||||||
"" Do default action for next item.
|
" Do default action for next item.
|
||||||
"nnoremap <silent> <space>j :<C-u>CocNext<CR>
|
nnoremap <silent> <space>j :<C-u>CocNext<CR>
|
||||||
"" Do default action for previous item.
|
" Do default action for previous item.
|
||||||
"nnoremap <silent> <space>k :<C-u>CocPrev<CR>
|
nnoremap <silent> <space>k :<C-u>CocPrev<CR>
|
||||||
"" Resume latest coc list
|
" Resume latest coc list
|
||||||
"nnoremap <silent> <space>p :<C-u>CocListResume<CR>
|
nnoremap <silent> <space>p :<C-u>CocListResume<CR>
|
||||||
|
|||||||
Reference in New Issue
Block a user