|
|
@ -1,104 +1,170 @@
|
|
|
|
set nocompatible
|
|
|
|
set nocompatible
|
|
|
|
|
|
|
|
|
|
|
|
so ~/.config/nvim/plugins.vim
|
|
|
|
so ~/.config/nvim/plugins.vim
|
|
|
|
|
|
|
|
|
|
|
|
so ~/.config/nvim/word_processing.vim
|
|
|
|
so ~/.config/nvim/word_processing.vim
|
|
|
|
|
|
|
|
|
|
|
|
" --Plugin Configurations
|
|
|
|
" --Plugin Configurations
|
|
|
|
let g:go_gopls_enabled = 1
|
|
|
|
|
|
|
|
let g:go_go_fmt_command="gopls"
|
|
|
|
|
|
|
|
let g:go_gopls_gofumpt=1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let g:airline#extensions#tabline#enabled = 1
|
|
|
|
let g:airline#extensions#tabline#enabled = 1
|
|
|
|
let g:airline_powerline_fonts = 1
|
|
|
|
let g:airline_powerline_fonts = 1
|
|
|
|
|
|
|
|
let g:airline_theme='base16_bespin'
|
|
|
|
|
|
|
|
let g:formatdef_gunk = '"gunk format -"'
|
|
|
|
|
|
|
|
let g:formatters_gunk = ['gunk']
|
|
|
|
|
|
|
|
let g:go_go_fmt_command="gopls"
|
|
|
|
|
|
|
|
let g:go_gopls_enabled = 1
|
|
|
|
|
|
|
|
let g:go_gopls_gofumpt=1
|
|
|
|
|
|
|
|
let g:pandoc#command#autoexec_command = "Pandoc! pdf --citeproc"
|
|
|
|
|
|
|
|
let g:pandoc#formatting#mode = 'ha'
|
|
|
|
|
|
|
|
let g:pandoc#formatting#textwidth = 100
|
|
|
|
|
|
|
|
let g:pandoc#spell#enabled = 0
|
|
|
|
let g:svelte_indent_script = 0
|
|
|
|
let g:svelte_indent_script = 0
|
|
|
|
let g:svelte_indent_style = 0
|
|
|
|
let g:svelte_indent_style = 0
|
|
|
|
|
|
|
|
|
|
|
|
set title "Update title of the terminal
|
|
|
|
"--My ColorScheme
|
|
|
|
set number "Display line numbers
|
|
|
|
set background=dark
|
|
|
|
|
|
|
|
set termguicolors
|
|
|
|
|
|
|
|
let g:srcery_italic=1
|
|
|
|
|
|
|
|
let g:srcery_bold=1
|
|
|
|
|
|
|
|
let g:srcery_white='#FCE8C3'
|
|
|
|
|
|
|
|
let g:srcery_bright_white='#FCF5E8'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
colorscheme srcery
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" General
|
|
|
|
|
|
|
|
set noerrorbells
|
|
|
|
|
|
|
|
set title
|
|
|
|
|
|
|
|
set number
|
|
|
|
set relativenumber
|
|
|
|
set relativenumber
|
|
|
|
set ruler "Display cursor position
|
|
|
|
set signcolumn=number
|
|
|
|
set wrap "Wrap lines when they are long
|
|
|
|
set ruler
|
|
|
|
set scrolloff=3 "Display 3 lines around the cursor when scrolling
|
|
|
|
set wrap
|
|
|
|
set clipboard+=unnamedplus " use system clipboard
|
|
|
|
set scrolloff=3
|
|
|
|
|
|
|
|
set clipboard+=unnamedplus
|
|
|
|
|
|
|
|
set colorcolumn=81
|
|
|
|
set guicursor+=a:blinkon0
|
|
|
|
set guicursor+=a:blinkon0
|
|
|
|
|
|
|
|
set nofoldenable
|
|
|
|
|
|
|
|
set updatetime=300
|
|
|
|
|
|
|
|
set shortmess+=c
|
|
|
|
|
|
|
|
set mouse=a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Indentation and highlighting
|
|
|
|
filetype on
|
|
|
|
filetype on
|
|
|
|
filetype plugin on
|
|
|
|
filetype plugin on
|
|
|
|
filetype plugin indent on
|
|
|
|
filetype plugin indent on
|
|
|
|
filetype indent on
|
|
|
|
filetype indent on
|
|
|
|
|
|
|
|
|
|
|
|
"--Search
|
|
|
|
|
|
|
|
set ignorecase "Case insensitive search
|
|
|
|
|
|
|
|
set smartcase "Just in case I still want case sensitive search
|
|
|
|
|
|
|
|
"Case sensitive when there's upper case
|
|
|
|
|
|
|
|
set incsearch "Incremental search
|
|
|
|
|
|
|
|
set hlsearch "Highlight search results
|
|
|
|
|
|
|
|
noremap // :nohls<RETURN>
|
|
|
|
|
|
|
|
noremap ; :
|
|
|
|
|
|
|
|
command WQ wq
|
|
|
|
|
|
|
|
command Wq q
|
|
|
|
|
|
|
|
command W w
|
|
|
|
|
|
|
|
command Q w
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"--Beep
|
|
|
|
|
|
|
|
set noerrorbells "Vim is annoying
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set shiftwidth=4
|
|
|
|
set shiftwidth=4
|
|
|
|
set tabstop=4
|
|
|
|
set tabstop=4
|
|
|
|
set scrolloff=10
|
|
|
|
|
|
|
|
set softtabstop=0
|
|
|
|
set softtabstop=0
|
|
|
|
let &t_ut=''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set updatetime=100 "Vim gitgutter
|
|
|
|
" Searchstuff
|
|
|
|
|
|
|
|
set ignorecase
|
|
|
|
|
|
|
|
set smartcase
|
|
|
|
|
|
|
|
set incsearch
|
|
|
|
|
|
|
|
set hlsearch
|
|
|
|
|
|
|
|
|
|
|
|
"--My ColorScheme
|
|
|
|
" Purple comments and transparent background
|
|
|
|
set background=dark
|
|
|
|
|
|
|
|
set termguicolors
|
|
|
|
|
|
|
|
let g:srcery_italic=1
|
|
|
|
|
|
|
|
let g:srcery_bold=1
|
|
|
|
|
|
|
|
colorscheme srcery
|
|
|
|
|
|
|
|
hi Comment guifg=#b799bd ctermfg=102
|
|
|
|
hi Comment guifg=#b799bd ctermfg=102
|
|
|
|
hi Normal guibg=#NONE ctermbg=NONE
|
|
|
|
hi Normal guibg=#NONE ctermbg=NONE
|
|
|
|
|
|
|
|
|
|
|
|
let mapleader=","
|
|
|
|
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
|
|
|
|
inoremap jj <Esc>
|
|
|
|
|
|
|
|
inoremap <C-P> <C-\><C-O>:call CocActionAsync('showSignatureHelp')<CR>
|
|
|
|
|
|
|
|
inoremap <C-e> <ESC>:GoIfErr<CR>I<BS><CR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
noremap <leader>y :VCopy<CR>
|
|
|
|
lua <<EOF
|
|
|
|
vnoremap <leader>y :<BS><BS><BS><BS><BS>VCopyVisual<CR>
|
|
|
|
-- animated scrolling
|
|
|
|
|
|
|
|
require'neoscroll'.setup {
|
|
|
|
|
|
|
|
mappings = {'<C-u>', '<C-d>'},
|
|
|
|
|
|
|
|
hide_cursor = true,
|
|
|
|
|
|
|
|
stop_eof = true,
|
|
|
|
|
|
|
|
use_local_scrolloff = false,
|
|
|
|
|
|
|
|
respect_scrolloff = false,
|
|
|
|
|
|
|
|
cursor_scrolls_alone = true,
|
|
|
|
|
|
|
|
easing_function = nil,
|
|
|
|
|
|
|
|
pre_hook = nil,
|
|
|
|
|
|
|
|
post_hook = nil,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- better syntax highlighting
|
|
|
|
|
|
|
|
require'nvim-treesitter.configs'.setup {
|
|
|
|
|
|
|
|
highlight = { enable = true },
|
|
|
|
|
|
|
|
incremental_selection = { enable = true },
|
|
|
|
|
|
|
|
textobjects = { enable = true },
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
""""""""""""""""""""""""""""""""""""""""
|
|
|
|
|
|
|
|
" "
|
|
|
|
|
|
|
|
" KEYBINDS "
|
|
|
|
|
|
|
|
" "
|
|
|
|
|
|
|
|
""""""""""""""""""""""""""""""""""""""""
|
|
|
|
|
|
|
|
|
|
|
|
noremap <leader>w :e<SPACE>
|
|
|
|
inoremap jj <Esc>
|
|
|
|
noremap <leader>e :CocCommand explorer --toggle<CR>
|
|
|
|
noremap // :nohls<RETURN>
|
|
|
|
noremap <leader>E :Files<CR>
|
|
|
|
noremap ; :
|
|
|
|
noremap <leader>b :Buffers<CR>
|
|
|
|
command WQ wq
|
|
|
|
|
|
|
|
command Wq q
|
|
|
|
|
|
|
|
command W w
|
|
|
|
|
|
|
|
command Q w
|
|
|
|
|
|
|
|
|
|
|
|
nnoremap <C-k> :bprev<CR>
|
|
|
|
nnoremap <C-k> :bprev<CR>
|
|
|
|
nnoremap <C-j> :bnext<CR>
|
|
|
|
nnoremap <C-j> :bnext<CR>
|
|
|
|
inoremap <C-k> <Esc>:bprev<CR>
|
|
|
|
inoremap <C-k> <Esc>:bprev<CR>
|
|
|
|
inoremap <C-j> <Esc>:bnext<CR>
|
|
|
|
inoremap <C-j> <Esc>:bnext<CR>
|
|
|
|
|
|
|
|
nnoremap gf :e <cfile>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
noremap <Up> <Nop>
|
|
|
|
|
|
|
|
noremap <Right> <Nop>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inoremap <C-P> <C-\><C-O>:call CocActionAsync('showSignatureHelp')<CR>
|
|
|
|
|
|
|
|
noremap <silent> <Left> :call CocAction('diagnosticNext')<CR>
|
|
|
|
|
|
|
|
noremap <silent> <Down> :call CocAction('diagnosticPrevious')<CR>
|
|
|
|
|
|
|
|
nnoremap <silent> K :call <SID>show_documentation()<CR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let mapleader=","
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nnoremap <leader>w :e<SPACE>
|
|
|
|
|
|
|
|
nnoremap <leader>E :Files<CR>
|
|
|
|
|
|
|
|
nnoremap <leader>b :Buffers<CR>
|
|
|
|
nnoremap <leader>d :bp<cr>:bd #<cr>
|
|
|
|
nnoremap <leader>d :bp<cr>:bd #<cr>
|
|
|
|
|
|
|
|
|
|
|
|
" (f)ind in file, (g)rep, (h)elp
|
|
|
|
nmap <leader>a <Plug>(coc-codeaction-selected)
|
|
|
|
noremap <leader>f :tabnew<CR>:Find<CR>
|
|
|
|
noremap <leader>y :VCopy<CR>
|
|
|
|
noremap <leader>g :GoRun<CR>
|
|
|
|
vnoremap <leader>y :<BS><BS><BS><BS><BS>VCopyVisual<CR>
|
|
|
|
noremap <leader>h :help<SPACE>
|
|
|
|
noremap <leader>pd :Pandoc pdf --citeproc -Vmainfont="TeX Gyre Schola"
|
|
|
|
|
|
|
|
\ -Vmathfont="TeX Gyre Schola Math" -Vdocumentclass="scrartcl"
|
|
|
|
|
|
|
|
\ --resource-path=images --highlight-style ~/.config/pandoc/code.theme
|
|
|
|
|
|
|
|
\ -Fpandoc-crossref -Fpandoc-include -Fpantable <CR>
|
|
|
|
|
|
|
|
|
|
|
|
noremap <leader>p :PrettierAsync<CR>
|
|
|
|
nnoremap <leader>g :GoRun<CR>
|
|
|
|
noremap <leader>so :so ~/.config/nvim/init.vim<CR>
|
|
|
|
nnoremap <leader>f :PrettierAsync<CR>
|
|
|
|
|
|
|
|
nnoremap <leader>so :so ~/.config/nvim/init.vim<CR>
|
|
|
|
|
|
|
|
nnoremap <leader>e :CocCommand explorer --toggle<CR>
|
|
|
|
|
|
|
|
|
|
|
|
if exists('g:started_by_firenvim')
|
|
|
|
noremap <A-j> dap } p
|
|
|
|
au BufEnter github.com_*.txt set filetype=markdown
|
|
|
|
noremap <A-k> vap :m '<-2<CR>gv=gv
|
|
|
|
au BufEnter play.golang.org_*.txt set filetype=go
|
|
|
|
|
|
|
|
inoremap <A-w> <C-w>
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
autocmd FileType html,css,scss setlocal ts=4 sts=4 sw=4 expandtab
|
|
|
|
" COC
|
|
|
|
autocmd FileType javascript,typescript,typescriptreact,svelte setlocal ts=2 sts=2 sw=2 expandtab
|
|
|
|
nmap <silent> gd <Plug>(coc-definition)
|
|
|
|
autocmd FileType markdown setlocal ts=2 sts=2 sw=2 expandtab
|
|
|
|
nmap <silent> gy <Plug>(coc-type-definition)
|
|
|
|
autocmd FileType sql setlocal ts=2 sts=2 sw=2 expandtab
|
|
|
|
nmap <silent> gi <Plug>(coc-implementation)
|
|
|
|
|
|
|
|
nmap <silent> gr <Plug>(coc-references)
|
|
|
|
|
|
|
|
nmap <leader>rn <Plug>(coc-rename)
|
|
|
|
|
|
|
|
nnoremap <leader>o :<C-u>CocList outline<cr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
""""""""""""""""""""""""""""""""""""""""
|
|
|
|
|
|
|
|
" "
|
|
|
|
|
|
|
|
" FILE TYPES "
|
|
|
|
|
|
|
|
" "
|
|
|
|
|
|
|
|
""""""""""""""""""""""""""""""""""""""""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
autocmd FileType html,css,scss
|
|
|
|
|
|
|
|
\ setlocal ts=4 sts=4 sw=4 expandtab
|
|
|
|
|
|
|
|
autocmd FileType javascript,typescript,typescriptreact,svelte
|
|
|
|
|
|
|
|
\ setlocal ts=2 sts=2 sw=2 expandtab
|
|
|
|
|
|
|
|
autocmd BufNewFile,BufRead *.markdown,*.text
|
|
|
|
|
|
|
|
\ setlocal ts=2 sts=2 sw=2 textwidth=100 colorcolumn=101
|
|
|
|
|
|
|
|
autocmd FileType sql
|
|
|
|
|
|
|
|
\setlocal ts=2 sts=2 sw=2 expandtab
|
|
|
|
|
|
|
|
autocmd BufNewFile,BufRead *.md.tmpl
|
|
|
|
|
|
|
|
\ setlocal filetype=markdown
|
|
|
|
autocmd BufNewFile,BufRead .*config,*.config,config
|
|
|
|
autocmd BufNewFile,BufRead .*config,*.config,config
|
|
|
|
\ setlocal filetype=gitconfig
|
|
|
|
\ setlocal filetype=gitconfig
|
|
|
|
autocmd BufNewFile,BufRead *.bolt
|
|
|
|
autocmd BufNewFile,BufRead *.bolt
|
|
|
@ -119,33 +185,12 @@ autocmd BufNewFile,BufRead *.gltf
|
|
|
|
\ setlocal filetype=gltf syntax=json
|
|
|
|
\ setlocal filetype=gltf syntax=json
|
|
|
|
autocmd BufNewFile,BufRead *.frag
|
|
|
|
autocmd BufNewFile,BufRead *.frag
|
|
|
|
\ setlocal filetype=glsl syntax=glsl
|
|
|
|
\ setlocal filetype=glsl syntax=glsl
|
|
|
|
|
|
|
|
autocmd BufWrite *.gunk
|
|
|
|
|
|
|
|
\ :Autoformat
|
|
|
|
|
|
|
|
|
|
|
|
" Coc.NVIM
|
|
|
|
let g:coc_snippet_next = '<tab>'
|
|
|
|
" Set internal encoding of vim, not needed on neovim, since coc.nvim using some
|
|
|
|
let g:coc_snippetnext = '<tab>'
|
|
|
|
" unicode characters in the file autoload/float.vim
|
|
|
|
autocmd CursorHold * silent call CocActionAsync('highlight')
|
|
|
|
set encoding=utf-8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" TextEdit might fail if hidden is not set.
|
|
|
|
|
|
|
|
set hidden
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Give more space for displaying messages.
|
|
|
|
|
|
|
|
set cmdheight=2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
|
|
|
|
|
|
|
|
" delays and poor user experience.
|
|
|
|
|
|
|
|
set updatetime=300
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Don't pass messages to |ins-completion-menu|.
|
|
|
|
|
|
|
|
set shortmess+=c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Always show the signcolumn, otherwise it would shift the text each time
|
|
|
|
|
|
|
|
" diagnostics appear/become resolved.
|
|
|
|
|
|
|
|
if has("patch-8.1.1564")
|
|
|
|
|
|
|
|
" Recently vim can merge signcolumn and number column into one
|
|
|
|
|
|
|
|
set signcolumn=number
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
set signcolumn=yes
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inoremap <silent><expr> <TAB>
|
|
|
|
inoremap <silent><expr> <TAB>
|
|
|
|
\ pumvisible() ? coc#_select_confirm() :
|
|
|
|
\ pumvisible() ? coc#_select_confirm() :
|
|
|
@ -157,25 +202,12 @@ 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
|
|
|
|
let g:coc_snippet_next = '<tab>'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Map <tab> for trigger completion
|
|
|
|
|
|
|
|
let g:coc_snippetnext = '<tab>'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inoremap <silent><expr> <c-space> coc#refresh()
|
|
|
|
inoremap <silent><expr> <c-space> coc#refresh()
|
|
|
|
|
|
|
|
|
|
|
|
" Make <CR> auto-select the first completion item and notify coc.nvim to
|
|
|
|
|
|
|
|
" format on enter, <cr> could be remapped by other vim plugin
|
|
|
|
|
|
|
|
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm()
|
|
|
|
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm()
|
|
|
|
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
|
|
|
|
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
|
|
|
|
" GoTo code navigation.
|
|
|
|
|
|
|
|
nmap <silent> gd <Plug>(coc-definition)
|
|
|
|
|
|
|
|
nmap <silent> gy <Plug>(coc-type-definition)
|
|
|
|
|
|
|
|
nmap <silent> gi <Plug>(coc-implementation)
|
|
|
|
|
|
|
|
nmap <silent> gr <Plug>(coc-references)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Use K to show documentation in preview window.
|
|
|
|
|
|
|
|
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)
|
|
|
@ -209,12 +241,6 @@ function! s:doHover()
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endfunction
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
|
|
|
|
" Highlight the symbol and its references when holding the cursor.
|
|
|
|
|
|
|
|
autocmd CursorHold * silent call CocActionAsync('highlight')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Symbol renaming.
|
|
|
|
|
|
|
|
nmap <leader>rn <Plug>(coc-rename)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
augroup mygroup
|
|
|
|
augroup mygroup
|
|
|
|
autocmd!
|
|
|
|
autocmd!
|
|
|
|
" Setup formatexpr specified filetype(s).
|
|
|
|
" Setup formatexpr specified filetype(s).
|
|
|
@ -223,96 +249,3 @@ augroup mygroup
|
|
|
|
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
|
|
|
|
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
|
|
|
|
augroup end
|
|
|
|
augroup end
|
|
|
|
|
|
|
|
|
|
|
|
" Map function and class text objects
|
|
|
|
|
|
|
|
" NOTE: Requires 'textDocument.documentSymbol' support from the language server.
|
|
|
|
|
|
|
|
xmap if <Plug>(coc-funcobj-i)
|
|
|
|
|
|
|
|
omap if <Plug>(coc-funcobj-i)
|
|
|
|
|
|
|
|
xmap af <Plug>(coc-funcobj-a)
|
|
|
|
|
|
|
|
omap af <Plug>(coc-funcobj-a)
|
|
|
|
|
|
|
|
xmap ic <Plug>(coc-classobj-i)
|
|
|
|
|
|
|
|
omap ic <Plug>(coc-classobj-i)
|
|
|
|
|
|
|
|
xmap ac <Plug>(coc-classobj-a)
|
|
|
|
|
|
|
|
omap ac <Plug>(coc-classobj-a)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Remap <C-f> and <C-b> for scroll float windows/popups.
|
|
|
|
|
|
|
|
if has('nvim-0.4.0') || has('patch-8.2.0750')
|
|
|
|
|
|
|
|
nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
|
|
|
|
|
|
|
|
nnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
|
|
|
|
|
|
|
|
inoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(1)\<cr>" : "\<Right>"
|
|
|
|
|
|
|
|
inoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(0)\<cr>" : "\<Left>"
|
|
|
|
|
|
|
|
vnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
|
|
|
|
|
|
|
|
vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Add `:Format` command to format current buffer.
|
|
|
|
|
|
|
|
command! -nargs=0 Format :call CocAction('format')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Add `:Fold` command to fold current buffer.
|
|
|
|
|
|
|
|
command! -nargs=? Fold :call CocAction('fold', <f-args>)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Add `:OR` command for organize imports of the current buffer.
|
|
|
|
|
|
|
|
command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Add (Neo)Vim's native statusline support.
|
|
|
|
|
|
|
|
" NOTE: Please see `:h coc-status` for integrations with external plugins that
|
|
|
|
|
|
|
|
" provide custom statusline: lightline.vim, vim-airline.
|
|
|
|
|
|
|
|
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
|
|
|
|
|
|
|
|
let g:airline_theme='base16_bespin'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Mappings for CoCList
|
|
|
|
|
|
|
|
" Show all diagnostics.
|
|
|
|
|
|
|
|
nnoremap <silent><nowait> <space>a :<C-u>CocList diagnostics<cr>
|
|
|
|
|
|
|
|
" Manage extensions.
|
|
|
|
|
|
|
|
nnoremap <silent><nowait> <space>e :<C-u>CocList extensions<cr>
|
|
|
|
|
|
|
|
" Show commands.
|
|
|
|
|
|
|
|
nnoremap <silent><nowait> <space>c :<C-u>CocList commands<cr>
|
|
|
|
|
|
|
|
" Find symbol of current document.
|
|
|
|
|
|
|
|
nnoremap <silent><nowait> <space>o :<C-u>CocList outline<cr>
|
|
|
|
|
|
|
|
" Search workspace symbols.
|
|
|
|
|
|
|
|
nnoremap <silent><nowait> <space>s :<C-u>CocList -I symbols<cr>
|
|
|
|
|
|
|
|
" Do default action for next item.
|
|
|
|
|
|
|
|
nnoremap <silent><nowait> <space>j :<C-u>CocNext<CR>
|
|
|
|
|
|
|
|
" Do default action for previous item.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" filenames like *.xml, *.html, *.xhtml, ...
|
|
|
|
|
|
|
|
" These are the file extensions where this plugin is enabled.
|
|
|
|
|
|
|
|
"
|
|
|
|
|
|
|
|
let g:closetag_filenames = '*.html,*.xhtml,*.phtml,*.svelte'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" filenames like *.xml, *.xhtml, ...
|
|
|
|
|
|
|
|
" This will make the list of non-closing tags self-closing in the specified files.
|
|
|
|
|
|
|
|
"
|
|
|
|
|
|
|
|
let g:closetag_xhtml_filenames = '*.xhtml,*.jsx,*.svelte'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" filetypes like xml, html, xhtml, ...
|
|
|
|
|
|
|
|
" These are the file types where this plugin is enabled.
|
|
|
|
|
|
|
|
"
|
|
|
|
|
|
|
|
let g:closetag_filetypes = 'html,xhtml,phtml,svelte'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" filetypes like xml, xhtml, ...
|
|
|
|
|
|
|
|
" This will make the list of non-closing tags self-closing in the specified files.
|
|
|
|
|
|
|
|
"
|
|
|
|
|
|
|
|
let g:closetag_xhtml_filetypes = 'xhtml,jsx,svelte'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" integer value [0|1]
|
|
|
|
|
|
|
|
" This will make the list of non-closing tags case-sensitive (e.g. `<Link>` will be closed while `<link>` won't.)
|
|
|
|
|
|
|
|
"
|
|
|
|
|
|
|
|
let g:closetag_emptyTags_caseSensitive = 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" dict
|
|
|
|
|
|
|
|
" Disables auto-close if not in a "valid" region (based on filetype)
|
|
|
|
|
|
|
|
"
|
|
|
|
|
|
|
|
let g:closetag_regions = {
|
|
|
|
|
|
|
|
\ 'typescript.tsx': 'jsxRegion,tsxRegion',
|
|
|
|
|
|
|
|
\ 'javascript.jsx': 'jsxRegion',
|
|
|
|
|
|
|
|
\ 'typescriptreact': 'jsxRegion,tsxRegion',
|
|
|
|
|
|
|
|
\ 'javascriptreact': 'jsxRegion',
|
|
|
|
|
|
|
|
\ }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Shortcut for closing tags, default is '>'
|
|
|
|
|
|
|
|
"
|
|
|
|
|
|
|
|
let g:closetag_shortcut = '>'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Add > at current position without closing the current tag, default is ''
|
|
|
|
|
|
|
|
"
|
|
|
|
|
|
|
|
let g:closetag_close_shortcut = '<leader>>'
|
|
|
|
|
|
|
|