Merge remote-tracking branch 'Jidbo/master'
This commit is contained in:
commit
50b8665b09
5 changed files with 31 additions and 45 deletions
|
@ -3,13 +3,6 @@
|
||||||
" auto reload .vimrc on write
|
" auto reload .vimrc on write
|
||||||
autocmd BufWritePost init.vim source %
|
autocmd BufWritePost init.vim source %
|
||||||
|
|
||||||
" toggle hybrid number mode
|
|
||||||
:augroup numbertoggle
|
|
||||||
: autocmd!
|
|
||||||
: autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
|
|
||||||
: autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
|
|
||||||
:augroup END
|
|
||||||
|
|
||||||
" Delete buffer while keeping window layout (don't close buffer's windows).
|
" Delete buffer while keeping window layout (don't close buffer's windows).
|
||||||
" Version 2008-11-18 from http://vim.wikia.com/wiki/VimTip165
|
" Version 2008-11-18 from http://vim.wikia.com/wiki/VimTip165
|
||||||
if v:version < 700 || exists('loaded_bclose') || &cp
|
if v:version < 700 || exists('loaded_bclose') || &cp
|
||||||
|
|
|
@ -12,6 +12,7 @@ hi MatchParen guibg=NONE guifg=red gui=bold
|
||||||
|
|
||||||
" random settings
|
" random settings
|
||||||
set number
|
set number
|
||||||
|
set rnu
|
||||||
set clipboard=unnamed
|
set clipboard=unnamed
|
||||||
set mouse=nvi
|
set mouse=nvi
|
||||||
" set smarttab
|
" set smarttab
|
||||||
|
@ -27,7 +28,6 @@ set history=250
|
||||||
set noshowmode
|
set noshowmode
|
||||||
|
|
||||||
" tabs and line wrap
|
" tabs and line wrap
|
||||||
set tabstop=4
|
|
||||||
set wrapmargin=8
|
set wrapmargin=8
|
||||||
set softtabstop=0 noexpandtab
|
set softtabstop=0 noexpandtab
|
||||||
set shiftwidth=4
|
set shiftwidth=4
|
||||||
|
|
|
@ -41,6 +41,7 @@ augroup END
|
||||||
|
|
||||||
nmap <C-y> :Buffers<CR>
|
nmap <C-y> :Buffers<CR>
|
||||||
nmap <Leader>f :GFiles<CR>
|
nmap <Leader>f :GFiles<CR>
|
||||||
|
nmap <Leader>l :Lines<CR>
|
||||||
let g:fzf_buffers_jump = 1
|
let g:fzf_buffers_jump = 1
|
||||||
|
|
||||||
" VIMWIKI SETUP
|
" VIMWIKI SETUP
|
||||||
|
@ -81,6 +82,12 @@ lua require'colorizer'.setup()
|
||||||
|
|
||||||
let g:tmuxcomplete#trigger = ''
|
let g:tmuxcomplete#trigger = ''
|
||||||
|
|
||||||
|
" neo formatter
|
||||||
|
nnoremap <leader>p :Neoformat<CR>
|
||||||
|
|
||||||
|
" vim fugitive
|
||||||
|
nnoremap <leader>gg :G<cr>
|
||||||
|
|
||||||
" GOYO
|
" GOYO
|
||||||
" =========================
|
" =========================
|
||||||
|
|
||||||
|
@ -101,40 +108,22 @@ let g:goyo_linenr = 0
|
||||||
|
|
||||||
" AUTOCOMPLETION
|
" AUTOCOMPLETION
|
||||||
" =========================
|
" =========================
|
||||||
|
lua require'lspconfig'.tsserver.setup{ on_attach=require'completion'.on_attach }
|
||||||
|
lua require'lspconfig'.intelephense.setup{ on_attach=require'completion'.on_attach }
|
||||||
|
lua require'lspconfig'.vuels.setup{ on_attach=require'completion'.on_attach }
|
||||||
|
lua require'lspconfig'.pyls.setup{ on_attach=require'completion'.on_attach, plugins = {pycodestyle = {maxLineLength=120}} }
|
||||||
|
|
||||||
if executable('pyls')
|
imap <silent> <c-p> <Plug>(completion_trigger)
|
||||||
au User lsp_setup call lsp#register_server({
|
set completeopt=menuone,noinsert,noselect
|
||||||
\ 'name': 'pyls',
|
set shortmess+=c
|
||||||
\ 'cmd': {server_info->['pyls']},
|
|
||||||
\ 'whitelist': ['python'],
|
|
||||||
\ })
|
|
||||||
endif
|
|
||||||
|
|
||||||
function! s:on_lsp_buffer_enabled() abort
|
nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>
|
||||||
setlocal omnifunc=lsp#complete
|
nnoremap <silent> gh <cmd>lua vim.lsp.buf.hover()<CR>
|
||||||
setlocal signcolumn=yes
|
nnoremap <silent> gH <cmd>lua vim.lsp.buf.code_action()<CR>
|
||||||
nmap <buffer> gd <plug>(lsp-definition)
|
nnoremap <silent> gD <cmd>lua vim.lsp.buf.implementation()<CR>
|
||||||
nmap <buffer> <f2> <plug>(lsp-rename)
|
nnoremap <silent> gs <cmd>lua vim.lsp.buf.signature_help()<CR>
|
||||||
" refer to doc to add more commands
|
nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR>
|
||||||
endfunction
|
nnoremap <silent> gR <cmd>lua vim.lsp.buf.rename()<CR>
|
||||||
|
|
||||||
augroup lsp_install
|
|
||||||
au!
|
|
||||||
" call s:on_lsp_buffer_enabled only for languages that has the server registered.
|
|
||||||
autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled()
|
|
||||||
augroup END
|
|
||||||
|
|
||||||
" ULTISNIPS SETUP
|
|
||||||
" =========================
|
|
||||||
|
|
||||||
" Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
|
|
||||||
let g:UltiSnipsExpandTrigger="<tab>"
|
|
||||||
let g:UltiSnipsJumpForwardTrigger="<c-l>"
|
|
||||||
let g:UltiSnipsJumpBackwardTrigger="<c-h>"
|
|
||||||
let g:UltiSnipsSnippetDirectories=[$HOME."/.vim/snipps"]
|
|
||||||
|
|
||||||
" If you want :UltiSnipsEdit to split your window.
|
|
||||||
let g:UltiSnipsEditSplit="vertical"
|
|
||||||
|
|
||||||
" EMMET SETUP
|
" EMMET SETUP
|
||||||
" =========================
|
" =========================
|
||||||
|
|
|
@ -12,9 +12,6 @@ Plug 'tpope/vim-commentary'
|
||||||
" brackets management
|
" brackets management
|
||||||
Plug 'tpope/vim-surround'
|
Plug 'tpope/vim-surround'
|
||||||
|
|
||||||
" Snippets
|
|
||||||
Plug 'SirVer/ultisnips'
|
|
||||||
|
|
||||||
" Lanugage tool
|
" Lanugage tool
|
||||||
Plug 'dpelle/vim-LanguageTool'
|
Plug 'dpelle/vim-LanguageTool'
|
||||||
|
|
||||||
|
@ -67,8 +64,12 @@ Plug 'vim-airline/vim-airline'
|
||||||
" LANGUAGES
|
" LANGUAGES
|
||||||
" ===================
|
" ===================
|
||||||
|
|
||||||
" Linting
|
" nvim language server
|
||||||
Plug 'dense-analysis/ale'
|
Plug 'neovim/nvim-lspconfig'
|
||||||
|
Plug 'nvim-lua/completion-nvim'
|
||||||
|
|
||||||
|
" Autoformatter
|
||||||
|
Plug 'sbdchd/neoformat'
|
||||||
|
|
||||||
" disable latex before loading
|
" disable latex before loading
|
||||||
let g:polyglot_disabled = ["latex"]
|
let g:polyglot_disabled = ["latex"]
|
||||||
|
|
|
@ -1 +1,4 @@
|
||||||
alias vi="vim"
|
alias vi="vim"
|
||||||
|
|
||||||
|
# set prompt color
|
||||||
|
PROMPT_COLOR="blue"
|
||||||
|
|
Loading…
Add table
Reference in a new issue