vim: changed coc to nvim-lsp and changed colorscheme to personal one

master
tiyn 4 years ago
parent e257b26c36
commit 455636f403

@ -1,78 +0,0 @@
{
"languageserver": {
"ccls": {
"command": "ccls",
"filetypes": [
"c",
"cpp",
"objc",
"objcpp"
],
"rootPatterns": [
".ccls",
"compile_commands.json",
".vim/",
".git/",
".hg/"
],
"initializationOptions": {
"cache": {
"diretory": "/tmp/ccls"
}
}
},
"golang": {
"command": "gopls",
"rootPatterns": [
"go.mod",
".vim/",
".git/",
".hg/"
],
"filetypes": [
"go"
]
},
"haskell": {
"command": "haskell-language-server-wrapper",
"args": [
"--lsp"
],
"rootPatterns": [
"*.cabal",
"stack.yaml",
"cabal.project",
"package.yaml",
"hie.yaml"
],
"filetypes": [
"hs",
"lhs",
"haskell",
"lhaskell"
],
"initializationOptions": {
"haskell": {
}
}
},
"hdlChecker": {
"command": "hdl_checker",
"args": [
"--lsp"
],
"filetypes": [
"vhdl",
"verilog",
"systemverilog"
]
},
"nim": {
"command": "nimlsp",
"filetypes": [
"nim"
],
"trace.server": "verbose"
}
}
}

@ -15,22 +15,21 @@ Plug 'donRaphaco/neotex' , {'for': 'tex'} " asynchronous pdf rendering for pdf
Plug 'fatih/vim-go' , {'for': 'go'} " better support for golang Plug 'fatih/vim-go' , {'for': 'go'} " better support for golang
Plug 'itchyny/lightline.vim' " fancy statusline Plug 'itchyny/lightline.vim' " fancy statusline
Plug 'junegunn/fzf.vim' " quickly jump files using fzf Plug 'junegunn/fzf.vim' " quickly jump files using fzf
Plug 'lervag/vimtex' , {'for' : 'tex'} " tex library for autocompletion
Plug 'luochen1990/rainbow' " colorized matching brackets Plug 'luochen1990/rainbow' " colorized matching brackets
Plug 'majutsushi/tagbar', {'on': 'TagbarToggle'} " show tags Plug 'majutsushi/tagbar', {'on': 'TagbarToggle'} " show tags
Plug 'mattesgroeger/vim-bookmarks' " Set Bookmarks Plug 'mattesgroeger/vim-bookmarks' " Set Bookmarks
Plug 'neoclide/coc.nvim', {'do': 'yarn install --frozen-lockfile'} " autocompletion Plug 'neovim/nvim-lspconfig' " Language server client
Plug 'nvim-lua/completion-nvim' " Automatically open the omni completion window while typing
Plug 'qpkorr/vim-renamer' " bulk renamer Plug 'qpkorr/vim-renamer' " bulk renamer
Plug 'raimondi/delimitmate' " automatic closing of brackets Plug 'raimondi/delimitmate' " automatic closing of brackets
Plug 'rrethy/vim-hexokinase' , {'do': 'make hexokinase'} " color Preview Plug 'rrethy/vim-hexokinase' , {'do': 'make hexokinase'} " color Preview
Plug 'ryanoasis/vim-devicons' " enable icons for vim Plug 'ryanoasis/vim-devicons' " enable icons for vim
Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'} " filetree Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'} " filetree
Plug 'sirver/ultisnips' " snippets Plug 'sirver/ultisnips' " snippets
Plug 'tomasiser/vim-code-dark' " adding colorscheme Plug 'tiyn/vim-tccs' " custom colorscheme
Plug 'tpope/vim-fugitive' " git wrapper Plug 'tpope/vim-fugitive' " git wrapper
Plug 'tpope/vim-surround' " help for quotes/parantheses Plug 'tpope/vim-surround' " help for quotes/parantheses
Plug 'uiiaoo/java-syntax.vim' , {'for': 'java'} " better syntax highlight for java than default Plug 'uiiaoo/java-syntax.vim' , {'for': 'java'} " better syntax highlight for java than default
Plug 'whonore/coqtail' , {'for': 'v'} " coq interactive proof
Plug 'zah/nim.vim' , {'for': 'nim'} " Highlighting for nim Plug 'zah/nim.vim' , {'for': 'nim'} " Highlighting for nim
call plug#end() call plug#end()
@ -54,8 +53,7 @@ let g:neotex_enabled = 2
let g:go_def_mapping_enabled = 0 let g:go_def_mapping_enabled = 0
" itchyny/lightline.vim " itchyny/lightline.vim
let g:lightline = { 'colorscheme': 'codedark'} let g:lightline = { 'colorscheme': 'tccs'}
set noshowmode
" junegunn/fzf.vim " junegunn/fzf.vim
let $FZF_DEFAULT_COMMAND = 'find . ~ -type f' let $FZF_DEFAULT_COMMAND = 'find . ~ -type f'
@ -103,71 +101,55 @@ nmap mm <Plug>BookmarkToggle
nmap ma <Plug>BookmarkAnnotate nmap ma <Plug>BookmarkAnnotate
nmap ms <Plug>BookmarkShowAll nmap ms <Plug>BookmarkShowAll
nmap mn <Plug>BookmarkNext nmap mn <Plug>BookmarkNext
nmap mb <Plug>BookmarkPrev nmap mp <Plug>BookmarkPrev
nmap mc <Plug>BookmarkClear nmap mc <Plug>BookmarkClear
highlight BookmarkSign ctermbg=NONE ctermfg=160 highlight BookmarkSign ctermbg=NONE ctermfg=160
highlight BookmarkLine ctermbg=194 ctermfg=NONE highlight BookmarkLine ctermbg=194 ctermfg=NONE
let g:bookmark_sign = 'B' let g:bookmark_sign = 'B'
let g:bookmark_highlight_lines = 1 let g:bookmark_highlight_lines = 1
" neoclide/coc.nvim " neovim/nvim-lspconfig
inoremap <silent><expr> <TAB> lua << EOF
\ pumvisible() ? "\<C-n>" : local nvim_lsp = require('lspconfig')
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh() -- Use an on_attach function to only map the following keys
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>" -- after the language server attaches to the current buffer
local on_attach = function(client, bufnr)
function! s:check_back_space() abort local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
let col = col('.') - 1 local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
return !col || getline('.')[col - 1] =~# '\s'
endfunction -- Mappings.
local opts = { noremap=true, silent=true }
let g:coc_global_extensions = [
\ 'coc-java', -- See `:help vim.lsp.*` for documentation on any of the below functions
\ 'coc-markdownlint', buf_set_keymap('n', 'gD', '<Cmd>lua vim.lsp.buf.declaration()<CR>', opts)
\ 'coc-pyright', buf_set_keymap('n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
\ 'coc-sh', buf_set_keymap('n', 'gy', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
\ 'coc-tsserver', buf_set_keymap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
\ 'coc-vimtex', buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
\ ] buf_set_keymap('n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>', opts)
buf_set_keymap('n', '<F5>', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
if has('nvim')
inoremap <silent><expr> <c-space> coc#refresh() end
else
inoremap <silent><expr> <c-@> coc#refresh() -- Use a loop to conveniently call 'setup' on multiple servers and
endif -- map buffer local keybindings when the language server attaches
local servers = { "pyright", "java_language_server", "bashls", "tsserver", "texlab", "ccls", "gopls", "hls", "nimls" }
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm() for _, lsp in ipairs(servers) do
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>" nvim_lsp[lsp].setup {
on_attach=on_attach,
nmap <silent> gd <Plug>(coc-definition) flags = {
nmap <silent> gy <Plug>(coc-type-definition) debounce_text_changes = 150
nmap <silent> gi <Plug>(coc-implementation) }
nmap <silent> gr <Plug>(coc-references) }
nnoremap <silent> K :call <SID>show_documentation()<CR> end
EOF
function! s:show_documentation() autocmd BufEnter * lua require'completion'.on_attach()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>') " nvim-lua/completion-nvim
elseif (coc#rpc#ready()) let g:completion_matching_strategy_list = [ 'exact', 'substring', 'fuzzy', 'all' ]
call CocActionAsync('doHover') let g:completion_matching_smart_case = 1
else let g:completion_enable_snippet = 'UltiSnips'
execute '!' . &keywordprg . " " . expand('<cword>')
endif
endfunction
autocmd CursorHold * silent call CocActionAsync('highlight')
nmap <F5> <Plug>(coc-rename)
xmap <leader>f <Plug>(coc-format-selected)
nmap <leader>f <Plug>(coc-format-selected)
augroup mygroup
autocmd!
autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
augroup end
" rrethy/vim-hexokinase " rrethy/vim-hexokinase
let g:Hexokinase_refreshEvents = ['InsertLeave'] let g:Hexokinase_refreshEvents = ['InsertLeave']
@ -202,23 +184,15 @@ nnoremap <leader>gr :Gread<CR>
nnoremap <leader>gu :diffget //2<CR> nnoremap <leader>gu :diffget //2<CR>
nnoremap <leader>gs :G<CR> nnoremap <leader>gs :G<CR>
" whonore/coqtail
function g:CoqtailHighlight()
hi def CoqtailChecked guifg=#44FF44
hi def CoqtailSent guifg=#777777
endfunction
""" end plugin section """ end plugin section
set go=a set go=a
set noshowmode
" enable mouse for all modes " enable mouse for all modes
set mouse=a set mouse=a
set clipboard+=unnamedplus set clipboard+=unnamedplus
" enable command completion
set wildmode=longest,list,full
" setting Tab-length " setting Tab-length
set expandtab set expandtab
set softtabstop=4 set softtabstop=4
@ -239,6 +213,14 @@ filetype plugin on
" enable syntax highlighting " enable syntax highlighting
syntax on syntax on
" enable specify completion options
set shortmess+=c
set completeopt=menuone,noinsert,noselect
inoremap <expr> <Tab> pumvisible() ? '<C-n>' : '<Tab>'
inoremap <expr> <S-Tab> pumvisible() ? '<C-p>' : '<S-Tab>'
inoremap <expr> <Down> pumvisible() ? '<C-n>' : '<Down>'
inoremap <expr> <Up> pumvisible() ? '<C-p>' : '<Up>'
" enable true colors " enable true colors
set termguicolors set termguicolors
@ -259,9 +241,6 @@ set hidden
set nobackup set nobackup
set nowritebackup set nowritebackup
" dont pass messages to ins-completion-menu
set shortmess+=c
" always show the signcolumn, otherwise it would shift the text each time " always show the signcolumn, otherwise it would shift the text each time
" diagnostics appear/become resolved. " diagnostics appear/become resolved.
if has("patch-8.1.1564") if has("patch-8.1.1564")
@ -362,9 +341,9 @@ autocmd BufEnter,FileType tex set colorcolumn=80
autocmd BufEnter,FileType nim set colorcolumn=80 autocmd BufEnter,FileType nim set colorcolumn=80
autocmd BufEnter,FileType python set colorcolumn=80 autocmd BufEnter,FileType python set colorcolumn=80
" colorscheme "" colorscheme
set background=dark set background=dark
colorscheme codedark colorscheme tccs
highlight colorcolumn guibg=#772222 highlight colorcolumn guibg=#772222
" python " python

Loading…
Cancel
Save