Update vim config
This commit is contained in:
parent
a9815d3f5b
commit
e60e881215
|
@ -1,12 +1,12 @@
|
||||||
" __
|
" __
|
||||||
" / -,
|
" / -,
|
||||||
" || ) ; '
|
" || ) ; '
|
||||||
" ~||---) _-_ /'\\ \\/\ \\ \\/\\/\\
|
" ~||---) _-_ /'\\ \\/\ \\ \\/\\/\\
|
||||||
" ~||---, || \\ || || || | || || || ||
|
" ~||---, || \\ || || || | || || || ||
|
||||||
" ~|| / ||/ || || || | || || || ||
|
" ~|| / ||/ || || || | || || || ||
|
||||||
" |, / \\,/ \\,/ \\/ \\ \\ \\ \\
|
" |, / \\,/ \\,/ \\/ \\ \\ \\ \\
|
||||||
" -_- --~
|
" -_- --~
|
||||||
"
|
"
|
||||||
|
|
||||||
" import .vimrc
|
" import .vimrc
|
||||||
set runtimepath^=~/.vim runtimepath+=~/.vim/after
|
set runtimepath^=~/.vim runtimepath+=~/.vim/after
|
||||||
|
@ -24,7 +24,17 @@ set updatetime=500
|
||||||
nnoremap <C-c><C-a> :lua vim.lsp.buf.code_action()<CR>
|
nnoremap <C-c><C-a> :lua vim.lsp.buf.code_action()<CR>
|
||||||
|
|
||||||
" ale
|
" ale
|
||||||
let g:ale_linters = {'rust': ['analyzer']}
|
let g:ale_linters = {'rust': ['analyzer'], 'css': ['csslint']}
|
||||||
|
|
||||||
|
let g:ale_fixers = {
|
||||||
|
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
|
||||||
|
\ 'html': ['prettier'],
|
||||||
|
\ 'css': ['prettier'],
|
||||||
|
\ }
|
||||||
|
|
||||||
|
let g:ale_fix_on_save = 1
|
||||||
|
|
||||||
|
let g:ale_javascript_prettier_options = '--tab-width 4'
|
||||||
|
|
||||||
let g:ale_rust_analyzer_config = {
|
let g:ale_rust_analyzer_config = {
|
||||||
\ 'cargo': { 'loadOutDirsFromCheck': v:true },
|
\ 'cargo': { 'loadOutDirsFromCheck': v:true },
|
||||||
|
@ -52,12 +62,12 @@ let g:lightline.component_type = {
|
||||||
\ 'linter_ok': 'right',
|
\ 'linter_ok': 'right',
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
" lightline symbols
|
" lightline symbols
|
||||||
let g:lightline#ale#indicator_checking = "\uf110"
|
let g:lightline#ale#indicator_checking = "\uf110"
|
||||||
let g:lightline#ale#indicator_infos = "\uf129"
|
let g:lightline#ale#indicator_infos = "\uf129"
|
||||||
let g:lightline#ale#indicator_warnings = "\uf071"
|
let g:lightline#ale#indicator_warnings = "\uf071"
|
||||||
let g:lightline#ale#indicator_errors = "\uf05e"
|
let g:lightline#ale#indicator_errors = "\uf05e"
|
||||||
let g:lightline#ale#indicator_ok = "\uf00c"
|
let g:lightline#ale#indicator_ok = "\uf00c"
|
||||||
|
|
||||||
" lightline modules
|
" lightline modules
|
||||||
let g:lightline.active = {
|
let g:lightline.active = {
|
||||||
|
@ -66,23 +76,23 @@ let g:lightline.active = {
|
||||||
\ ['gitbranch', 'readonly', 'filename', 'modified']
|
\ ['gitbranch', 'readonly', 'filename', 'modified']
|
||||||
\ ],
|
\ ],
|
||||||
\ 'right': [
|
\ 'right': [
|
||||||
\ ['linter_checking', 'linter_errors', 'linter_warnings'],
|
\ ['linter_checking', 'linter_errors', 'linter_warnings'],
|
||||||
\ ['lineinfo'],
|
\ ['lineinfo'],
|
||||||
\ ['percent'],
|
\ ['percent'],
|
||||||
\ ['fileformat', 'fileencoding', 'filetype']
|
\ ['fileformat', 'fileencoding', 'filetype']
|
||||||
\ ]
|
\ ]
|
||||||
\}
|
\}
|
||||||
|
|
||||||
|
|
||||||
lua << EOF
|
lua << EOF
|
||||||
|
|
||||||
-- cursor animations
|
-- cursor animations
|
||||||
require('specs').setup{
|
require('specs').setup{
|
||||||
show_jumps = true,
|
show_jumps = true,
|
||||||
min_jump = 30,
|
min_jump = 30,
|
||||||
popup = {
|
popup = {
|
||||||
delay_ms = 100, -- delay before popup displays
|
delay_ms = 100, -- delay before popup displays
|
||||||
inc_ms = 20, -- time increments used for fade/resize effects
|
inc_ms = 20, -- time increments used for fade/resize effects
|
||||||
blend = 10, -- starting blend, between 0-100 (fully transparent), see :h winblend
|
blend = 10, -- starting blend, between 0-100 (fully transparent), see :h winblend
|
||||||
width = 10,
|
width = 10,
|
||||||
winhl = "PMenu",
|
winhl = "PMenu",
|
||||||
|
@ -95,15 +105,26 @@ require('specs').setup{
|
||||||
}
|
}
|
||||||
|
|
||||||
-- lsp config
|
-- lsp config
|
||||||
|
local lsp_installer = require("nvim-lsp-installer")
|
||||||
local nvim_lsp = require 'lspconfig'
|
local nvim_lsp = require 'lspconfig'
|
||||||
local cmp = require'cmp'
|
local cmp = require'cmp'
|
||||||
|
|
||||||
nvim_lsp.rust_analyzer.setup({})
|
lsp_installer.setup {
|
||||||
|
automatic_installation = true
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, server in ipairs(lsp_installer.get_installed_servers()) do
|
||||||
|
nvim_lsp[server.name].setup {}
|
||||||
|
end
|
||||||
|
|
||||||
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||||
require('lspconfig')['rust_analyzer'].setup {
|
local servers = { 'rust_analyzer', 'emmet_ls', 'cssls' }
|
||||||
capabilities = capabilities
|
for _, lsp in ipairs(servers) do
|
||||||
}
|
nvim_lsp[lsp].setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
vim.diagnostic.config({
|
vim.diagnostic.config({
|
||||||
virtual_text = {
|
virtual_text = {
|
||||||
|
|
35
.vimrc
35
.vimrc
|
@ -1,10 +1,17 @@
|
||||||
|
|
||||||
" ; '
|
" ; '
|
||||||
" \\/\ \\ \\/\\/\\ ,._-_ _-_
|
" \\/\ \\ \\/\\/\\ ,._-_ _-_
|
||||||
" || | || || || || || ||
|
" || | || || || || || ||
|
||||||
" || | || || || || || ||
|
" || | || || || || || ||
|
||||||
" \\/ \\ \\ \\ \\ \\, \\,/
|
" \\/ \\ \\ \\ \\ \\, \\,/
|
||||||
|
|
||||||
|
" Install VimPlug
|
||||||
|
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
|
||||||
|
if empty(glob(data_dir . '/autoload/plug.vim'))
|
||||||
|
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
||||||
|
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
" Load plugins
|
" Load plugins
|
||||||
call plug#begin('~/.vim/bundle')
|
call plug#begin('~/.vim/bundle')
|
||||||
|
@ -21,10 +28,11 @@ Plug 'lilydjwg/colorizer'
|
||||||
Plug 'mg979/vim-visual-multi'
|
Plug 'mg979/vim-visual-multi'
|
||||||
Plug 'owickstrom/vim-colors-paramount'
|
Plug 'owickstrom/vim-colors-paramount'
|
||||||
Plug 'raimondi/delimitmate'
|
Plug 'raimondi/delimitmate'
|
||||||
|
Plug 'scrooloose/nerdtree'
|
||||||
Plug 'tpope/vim-commentary'
|
Plug 'tpope/vim-commentary'
|
||||||
Plug 'vim-scripts/nginx.vim', {'for': 'nginx'}
|
Plug 'vim-scripts/nginx.vim', {'for': 'nginx'}
|
||||||
Plug 'yuttie/comfortable-motion.vim'
|
Plug 'yuttie/comfortable-motion.vim'
|
||||||
|
|
||||||
Plug 'ryanoasis/vim-devicons'
|
Plug 'ryanoasis/vim-devicons'
|
||||||
|
|
||||||
" don't install these plugins on remote servers
|
" don't install these plugins on remote servers
|
||||||
|
@ -34,7 +42,7 @@ if has('nvim')
|
||||||
Plug 'j-hui/fidget.nvim'
|
Plug 'j-hui/fidget.nvim'
|
||||||
Plug 'jghauser/mkdir.nvim'
|
Plug 'jghauser/mkdir.nvim'
|
||||||
Plug 'stevearc/dressing.nvim'
|
Plug 'stevearc/dressing.nvim'
|
||||||
Plug 'airblade/vim-gitgutter'
|
Plug 'airblade/vim-gitgutter'
|
||||||
Plug 'antoinemadec/FixCursorHold.nvim'
|
Plug 'antoinemadec/FixCursorHold.nvim'
|
||||||
Plug 'edluffy/specs.nvim'
|
Plug 'edluffy/specs.nvim'
|
||||||
Plug 'folke/lsp-colors.nvim'
|
Plug 'folke/lsp-colors.nvim'
|
||||||
|
@ -48,6 +56,7 @@ if has('nvim')
|
||||||
Plug 'hrsh7th/vim-vsnip'
|
Plug 'hrsh7th/vim-vsnip'
|
||||||
Plug 'kyazdani42/nvim-web-devicons'
|
Plug 'kyazdani42/nvim-web-devicons'
|
||||||
Plug 'maximbaz/lightline-ale'
|
Plug 'maximbaz/lightline-ale'
|
||||||
|
Plug 'williamboman/nvim-lsp-installer'
|
||||||
Plug 'neovim/nvim-lspconfig'
|
Plug 'neovim/nvim-lspconfig'
|
||||||
Plug 'nvim-lua/plenary.nvim'
|
Plug 'nvim-lua/plenary.nvim'
|
||||||
Plug 'nvim-telescope/telescope.nvim'
|
Plug 'nvim-telescope/telescope.nvim'
|
||||||
|
@ -56,7 +65,7 @@ if has('nvim')
|
||||||
Plug 'w0rp/ale'
|
Plug 'w0rp/ale'
|
||||||
Plug 'xuyuanp/nerdtree-git-plugin'
|
Plug 'xuyuanp/nerdtree-git-plugin'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
" Lightline config
|
" Lightline config
|
||||||
|
@ -73,14 +82,14 @@ let g:VM_maps = {}
|
||||||
let g:VM_maps["I BS"] = '<c-BS>'
|
let g:VM_maps["I BS"] = '<c-BS>'
|
||||||
|
|
||||||
" Nerdtree/git config
|
" Nerdtree/git config
|
||||||
let g:NERDTreeGitStatusConcealBrackets = 1
|
let g:NERDTreeGitStatusConcealBrackets = 1
|
||||||
|
|
||||||
|
|
||||||
" Aliases
|
" Aliases
|
||||||
command Header FIGlet -f Gothic
|
command Header FIGlet -f Gothic
|
||||||
cmap W w !sudo tee > /dev/null %
|
cmap W w !sudo tee > /dev/null %
|
||||||
nnoremap <C-e> :NERDTreeTabsToggle<CR>
|
nnoremap <C-e> :NERDTreeTabsToggle<CR>
|
||||||
|
|
||||||
" Colorscheme
|
" Colorscheme
|
||||||
set background=dark
|
set background=dark
|
||||||
set termguicolors
|
set termguicolors
|
||||||
|
@ -90,7 +99,7 @@ let bgcolor = synIDattr(hlID("Normal"), "bg")
|
||||||
let fgcolor = synIDattr(hlID("Identifier"), "fg")
|
let fgcolor = synIDattr(hlID("Identifier"), "fg")
|
||||||
let colors = "\033]11;" . fgcolor . "\007\033]11;" . bgcolor . "\007"
|
let colors = "\033]11;" . fgcolor . "\007\033]11;" . bgcolor . "\007"
|
||||||
|
|
||||||
if has('gui_running') || has('nvim')
|
if has('gui_running') || has('nvim')
|
||||||
autocmd VimEnter * call chansend(v:stderr, colors)
|
autocmd VimEnter * call chansend(v:stderr, colors)
|
||||||
autocmd VimLeave * call chansend(v:stderr, "\033]110\007\033]111\007")
|
autocmd VimLeave * call chansend(v:stderr, "\033]110\007\033]111\007")
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue