convert init.vim in modules, update zsh && git

This commit is contained in:
Smirnov Alexander 2021-06-02 19:40:42 +03:00
parent a4532907b4
commit eb4f1a5b5a
14 changed files with 170 additions and 73 deletions

View file

@ -1,63 +1,64 @@
call plug#begin('~/.vim/plugged')
Plug 'sheerun/vim-polyglot'
" LSP && Completion
Plug 'neovim/nvim-lspconfig'
Plug 'hrsh7th/nvim-compe'
Plug 'mattn/emmet-vim', {'on': ['EmmetInstall', 'Emmet']}
Plug 'jiangmiao/auto-pairs'
Plug 'mattn/emmet-vim', {'on': 'EmmetInstall'}
" File explorer
Plug 'junegunn/fzf.vim'
Plug 'kyazdani42/nvim-tree.lua'
" Git
Plug 'lewis6991/gitsigns.nvim'
" Theme
Plug 'Smirnov-O/nten.vim'
" Status line & Buffer line
Plug 'hoob3rt/lualine.nvim'
Plug 'romgrk/barbar.nvim'
" Better syntax hl
Plug 'sheerun/vim-polyglot'
Plug 'norcalli/nvim-colorizer.lua'
" Editor config
Plug 'editorconfig/editorconfig-vim'
" Other
Plug 'vimwiki/vimwiki'
Plug 'nvim-lua/plenary.nvim'
call plug#end()
"== General
colo codedark " Color scheme
set termguicolors " GUI colors
set nu rnu cul " Line numbers & cursor line highlight
set nolbr nowrap " Line wrap
set mouse=a mh " Mouse
set history=500 " Set history size
set autoread " Auto read file on change
set hidden " Change buffet without warning
set visualbell t_vb= " Disable sounds
set pumheight=8 " Maximum items in pop up
set modeline " Enable modeline
set nosmd " Disable show mode
set nobk noswf noudf " Swap files
set is ic scs " Search
let mapleader=";" " Set leader key
set spr " Split
set scrolloff=3
set enc=utf-8 fenc=utf-8 " Encoding
set list listchars=tab:\|·,trail:~,space
colo nvcode
let mapleader=";"
"== Tab(or spaces)
set ts=4 sw=4 sts=4
set sta et ai
"== Vim config
source $HOME/.config/nvim/vimscript/config.vim
"== Tab line
let bufferline = get(g:, 'bufferline', {})
let g:bufferline.icons = v:false
let g:bufferline.icon_close_tab = '🗴'
source $HOME/.config/nvim/vimscript/barbar.vim
"== Status line
lua require'lualine'.setup({options = {
\ theme = "codedark"
\ }})
luafile $HOME/.config/nvim/lua/n-lualine.lua
"== File explorer
luafile $HOME/.config/nvim/lua/n-nvimtree.lua
"== Git
luafile $HOME/.config/nvim/lua/n-gitsigns.lua
"== Emmet
let g:user_emmet_mode = "inc"
let g:user_emmet_leader_key=','
let g:user_emmet_settings = {'javascript': {
\ 'extends': 'jsx'
\ }}
source $HOME/.config/nvim/vimscript/emmet.vim
"== Colorizer
luafile $HOME/.config/nvim/lua/n-colorizer.lua
"== Notes
let g:vimwiki_list = [{'path': '~/notes', 'syntax': 'markdown', 'ext': '.md'}]
"== Completion(LSP)
ino <expr> <tab> pumvisible() ? "\<C-n>" : "\<tab>"
ino <expr> <s-tab> pumvisible() ? "\<C-p>" : "\<tab>"
ino <expr> <CR> compe#confirm('<CR>')
ino <expr> <cr> compe#confirm('<CR>')
nno sr :lua vim.lsp.buf.rename()<cr>
nno sh :lua vim.lsp.buf.hover()<cr>
nno si :lua vim.lsp.buf.definition()<cr>
@ -77,40 +78,17 @@ require'compe'.setup{
}
EOF
"== Netrw file tree
let g:netrw_liststyle = 3
let g:netrw_banner = 0
let g:netrw_dirhistmax = 0
"== Custom setting for another files
au FileType python,elm setl sw=4 ts=4
au FileType javascript,javascriptreact,json,yaml setl sw=2 ts=2
au FileType javascript,javascriptreact,css,scss,less EmmetInstall
au FileType javascript,json,yaml,lua setl sw=2 ts=2
au FileType javascript,vue,html,css,scss :EmmetInstall
au FileType go setl noet sw=4 ts=4
"== Custom commands
com! Prettier :sil !prettier -w %
com! Term :vs|winc L|se nonu nornu|start|term
com! GoFmt :sil !gofmt -w %
com! Black :sil !black %
"== Mapping
nn <C-s> :w<cr>
nn <space> :noh<cr>
tno <esc> <c-\><c-n>
nn <leader>t :Term<cr>
nn <leader>e :Ex<cr>
nn <leader>j :bn<cr>
nn <leader>k :bp<cr>
nn <leader>w :bd<cr>
nn <leader>; :FZF<cr>
nn <C-h> :wincmd h<cr>
nn <C-j> :wincmd j<cr>
nn <C-k> :wincmd k<cr>
nn <C-l> :wincmd l<cr>
nn spv :vs<cr>
nn sph :sp<cr>
nn spk :winc K<cr>
nn spl :winc L<cr>
source $HOME/.config/nvim/vimscript/mappings.vim