mirror of
https://github.com/olexsmir/dotfiles.git
synced 2026-01-15 08:41:34 +02:00
Update nvim
This commit is contained in:
parent
a01c2ab92c
commit
093639a28a
24 changed files with 102 additions and 119 deletions
|
|
@ -50,4 +50,4 @@ R Nemo desktop='^5' focus=on follow=on
|
|||
R Zathura desktop='^5' focus=on follow=on state=tiled
|
||||
R discord desktop='^6' focus=on follow=off
|
||||
R TelegramDesktop desktop='^6' focus=off follow=on
|
||||
R KeePassXC desktop='^7' focus=on follow=on
|
||||
R KeePassXC desktop='^7' focus=on follow=on
|
||||
|
|
|
|||
|
|
@ -1,9 +1,24 @@
|
|||
# NVIM
|
||||
|
||||
### Install LSP
|
||||
## Install nvim
|
||||
```bash
|
||||
yay -S neovim-nightly-bin
|
||||
```
|
||||
|
||||
## Install plugin manager(`vim-plug`)
|
||||
```bash
|
||||
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
|
||||
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
||||
```
|
||||
|
||||
## Install LSP servers
|
||||
```bash
|
||||
# tsserver(JS/TS)
|
||||
npm i -g typescript typescript-language-server
|
||||
|
||||
# Go(gopls)
|
||||
go get golang.org/x/tools/gopls@latest
|
||||
|
||||
# Python(pyls)
|
||||
pip install python-language-server
|
||||
```
|
||||
|
|
|
|||
|
|
@ -1,28 +1,33 @@
|
|||
call plug#begin('~/.vim/plugged')
|
||||
call plug#begin('~/.vim/plugged')
|
||||
Plug 'Smirnov-O/nten.vim'
|
||||
Plug 'b3nj5m1n/kommentary'
|
||||
" Plug 'mattn/emmet-vim', {'on': 'EmmetInstall'}
|
||||
Plug 'nvim-lua/plenary.nvim'
|
||||
Plug 'nvim-lua/popup.nvim'
|
||||
" Plug 'editorconfig/editorconfig-vim'
|
||||
Plug 'norcalli/nvim-colorizer.lua'
|
||||
Plug 'kyazdani42/nvim-web-devicons'
|
||||
" Status line && Tab line
|
||||
Plug 'hoob3rt/lualine.nvim'
|
||||
Plug 'romgrk/barbar.nvim'
|
||||
" LSP && Completion
|
||||
Plug 'neovim/nvim-lspconfig'
|
||||
Plug 'hrsh7th/nvim-compe'
|
||||
Plug 'jiangmiao/auto-pairs'
|
||||
Plug 'mattn/emmet-vim', {'on': 'EmmetInstall'}
|
||||
" File explorer
|
||||
Plug 'junegunn/fzf.vim'
|
||||
Plug 'kyazdani42/nvim-tree.lua'
|
||||
" Git
|
||||
Plug 'TimUntersberger/neogit'
|
||||
Plug 'lewis6991/gitsigns.nvim'
|
||||
" Theme
|
||||
Plug 'Smirnov-O/nten.vim'
|
||||
" Status line && Tab line
|
||||
Plug 'hoob3rt/lualine.nvim'
|
||||
Plug 'romgrk/barbar.nvim'
|
||||
" File explorer
|
||||
Plug 'kyazdani42/nvim-tree.lua'
|
||||
Plug 'nvim-telescope/telescope.nvim'
|
||||
" Better syntax hl
|
||||
Plug 'sheerun/vim-polyglot'
|
||||
Plug 'norcalli/nvim-colorizer.lua'
|
||||
" Other
|
||||
Plug 'nvim-lua/plenary.nvim'
|
||||
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
|
||||
call plug#end()
|
||||
|
||||
colo codedark
|
||||
let mapleader=";"
|
||||
set termguicolors
|
||||
|
||||
"== Tab(or spaces)
|
||||
set ts=4 sw=4 sts=4
|
||||
|
|
@ -35,18 +40,10 @@ com! Notes :Files ~/notes
|
|||
com! GoFmt :sil !gofmt -w %
|
||||
|
||||
"== Configs
|
||||
luafile $HOME/.config/nvim/lua/plugins.lua
|
||||
source $HOME/.config/nvim/vimscript/config.vim
|
||||
source $HOME/.config/nvim/vimscript/barbar.vim
|
||||
source $HOME/.config/nvim/vimscript/emmet.vim
|
||||
source /home/sasha/.config/nvim/vimscript/compe.vim
|
||||
source $HOME/.config/nvim/vimscript/compe.vim
|
||||
source $HOME/.config/nvim/vimscript/filetypes.vim
|
||||
source $HOME/.config/nvim/vimscript/mappings.vim
|
||||
luafile $HOME/.config/nvim/lua/n-compe.lua
|
||||
luafile $HOME/.config/nvim/lua/n-lualine.lua
|
||||
luafile $HOME/.config/nvim/lua/n-nvimtree.lua
|
||||
luafile $HOME/.config/nvim/lua/n-gitsigns.lua
|
||||
luafile $HOME/.config/nvim/lua/n-colorizer.lua
|
||||
|
||||
"== Custom setting for another files
|
||||
au FileType python,elm setl sw=4 ts=4 sts=2
|
||||
au FileType javascript,html,vue,jst,pug,css,less,scss,json,yaml,lua setl sw=2 ts=2 sts=2
|
||||
au FileType go setl noet sw=4 ts=4 sts=2
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
require'colorizer'.setup(
|
||||
{'*';}, {
|
||||
mode = 'background';
|
||||
RGB = true; -- #RGB hex codes
|
||||
RRGGBB = true; -- #RRGGBB hex codes
|
||||
RRGGBBAA = false; -- #RRGGBBAA hex codes
|
||||
rgb_fn = true; -- CSS rgb() and rgba() functions
|
||||
hsl_fn = false; -- CSS hsl() and hsla() functions
|
||||
css = false; -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
|
||||
css_fn = true; -- Enable all CSS *functions*: rgb_fn, hsl_fn
|
||||
names = false; -- "Name" codes like Blue
|
||||
}
|
||||
)
|
||||
11
config/nvim/lua/plug/colorizer.lua
Normal file
11
config/nvim/lua/plug/colorizer.lua
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
require'colorizer'.setup({'*';}, {
|
||||
mode = 'background';
|
||||
RGB = true;
|
||||
RRGGBB = true;
|
||||
RRGGBBAA = false;
|
||||
rgb_fn = true;
|
||||
hsl_fn = false;
|
||||
css = false;
|
||||
css_fn = true;
|
||||
names = false;
|
||||
})
|
||||
|
|
@ -1,7 +1,3 @@
|
|||
require'lspconfig'.tsserver.setup {}
|
||||
require'lspconfig'.gopls.setup {}
|
||||
require'lspconfig'.pyls.setup {}
|
||||
|
||||
require'compe'.setup {
|
||||
enabled = true,
|
||||
autocomplete = true,
|
||||
3
config/nvim/lua/plug/lspconfig.lua
Normal file
3
config/nvim/lua/plug/lspconfig.lua
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
require'lspconfig'.tsserver.setup {}
|
||||
require'lspconfig'.gopls.setup {}
|
||||
require'lspconfig'.pyls.setup {}
|
||||
1
config/nvim/lua/plug/neogit.lua
Normal file
1
config/nvim/lua/plug/neogit.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
require'neogit'.setup {}
|
||||
|
|
@ -2,7 +2,7 @@ local S = vim.g
|
|||
|
||||
-- Settings
|
||||
S.nvim_tree_side = "left"
|
||||
S.nvim_tree_ignore = {".git", ".cache", "node_modules", "venv"}
|
||||
S.nvim_tree_ignore = {".git", ".cache", "node_modules", "venv", "env"}
|
||||
S.nvim_tree_auto_close = 0
|
||||
S.nvim_tree_quit_on_open = 0
|
||||
S.nvim_tree_width = 24
|
||||
13
config/nvim/lua/plug/telescope.lua
Normal file
13
config/nvim/lua/plug/telescope.lua
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
local actions = require('telescope.actions')
|
||||
|
||||
require('telescope').setup{
|
||||
defaults = {
|
||||
prompt_prefix = "Search > ",
|
||||
selection_caret = " ",
|
||||
entry_prefix = " ",
|
||||
file_ignore_patterns = {"node_modules", "env", ".cache"},
|
||||
mappings = {
|
||||
i = {["<esc>"] = actions.close}
|
||||
};
|
||||
};
|
||||
}
|
||||
5
config/nvim/lua/plug/treesitter.lua
Normal file
5
config/nvim/lua/plug/treesitter.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
require'nvim-treesitter.configs'.setup {
|
||||
ensure_installed = {'javascript', 'typescript', 'python', 'go'};
|
||||
highlight = { enable = true };
|
||||
indent = { enable = true };
|
||||
}
|
||||
9
config/nvim/lua/plugins.lua
Normal file
9
config/nvim/lua/plugins.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
require'plug.compe'
|
||||
require'plug.lspconfig'
|
||||
require'plug.nvimtree'
|
||||
require'plug.lualine'
|
||||
require'plug.gitsigns'
|
||||
require'plug.neogit'
|
||||
require'plug.treesitter'
|
||||
require'plug.telescope'
|
||||
require'plug.colorizer'
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
" Settings
|
||||
let bufferline = get(g:, 'bufferline', {})
|
||||
let bufferline.icons = v:false
|
||||
let bufferline.icon_close_tab = '🗴'
|
||||
|
||||
" Mappings
|
||||
|
|
@ -15,5 +14,5 @@ nno <A-8> :BufferGoto 8<cr>
|
|||
nno <A-9> :BufferGoto 9<cr>
|
||||
nno <C-w> :BufferClose<cr>
|
||||
nno <S-x> :BufferClose!<cr>
|
||||
nno <leader> :BufferMoveNext<cr>
|
||||
nno <leader> :BufferMovePrevious<cr>
|
||||
nno <leader><right> :BufferMoveNext<cr>
|
||||
nno <leader><left> :BufferMovePrevious<cr>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
"== Vim config
|
||||
set termguicolors " GUI colors
|
||||
set nu rnu cul " Line numbers & cursor line highlight
|
||||
set nu rnu nocul " Line numbers & cursor line highlight
|
||||
set nolbr nowrap " Line wrap
|
||||
set mouse=a mh " Mouse
|
||||
set history=500 " Set history size
|
||||
|
|
|
|||
|
|
@ -5,5 +5,5 @@ let g:user_emmet_leader = ","
|
|||
let g:user_emmet_settings = {
|
||||
\ 'javascript': {'extends': 'jsx'}}
|
||||
|
||||
"== Auto load
|
||||
"== Load
|
||||
au FileType html,jst,pug,vue,css,less,scss :EmmetInstall
|
||||
|
|
|
|||
3
config/nvim/vimscript/filetypes.vim
Normal file
3
config/nvim/vimscript/filetypes.vim
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
au FileType python,elm setl sw=4 ts=4 sts=2
|
||||
au FileType go setl noet sw=4 ts=4 sts=2
|
||||
au FileType javascript,html,jst,pug,css,less,scss,json,yaml,lua,vim setl sw=2 ts=2 sts=2
|
||||
|
|
@ -2,7 +2,9 @@ nno <C-s> :w<cr>
|
|||
nno <space> :noh<cr>
|
||||
nno <leader>t :Term<cr>
|
||||
nno <leader>e :NvimTreeToggle<cr>
|
||||
nno <leader>; :Files<cr>
|
||||
nno <leader>; :Telescope fd<cr>
|
||||
nno <leader>: :Telescope git_files<cr>
|
||||
nno <leader>g :Neogit<cr>
|
||||
|
||||
" Buffer
|
||||
nno <leader>j :bn<cr>
|
||||
|
|
|
|||
|
|
@ -38,4 +38,3 @@ map sa shell zip -r archive.zip %s
|
|||
map ss shell tar -czvf archive.tar.gz %s
|
||||
map sd shell 7z a archive.7z %s
|
||||
map se shell extract %s
|
||||
|
||||
|
|
|
|||
|
|
@ -1,52 +0,0 @@
|
|||
# vim:ft=cfg
|
||||
|
||||
#== Web
|
||||
ext x?html?, has google-chrome, X, flag f = google-chrome $@
|
||||
ext x?html?, has firefox, X, flag f = firefox -- "$@"
|
||||
|
||||
#== Script
|
||||
ext py = python -- "$1"
|
||||
ext js = node -- "$1"
|
||||
ext sh = bash -- "$1"
|
||||
|
||||
#== Misc
|
||||
#mime ^text, lable editor = $EDITOR -- "$@"
|
||||
#mime ^text, label pager = $PAGER -- "$@"
|
||||
|
||||
|
||||
!mime ^text, label editor, ext json|csv|tex|py|rb|js|sh = ${EDITOR} -- "$@"
|
||||
!mime ^text, label pager, ext json|csv|tex|py|rb|js|sh = "$PAGER" -- "$@"
|
||||
name ^[mM]akefile$ = make
|
||||
|
||||
|
||||
#== Video/Audio
|
||||
mime ^video, has mpv, X, flag f = mpv -- "$@"
|
||||
mime ^video, has mpv, X, flag f = mpv --fs -- "$@"
|
||||
mime ^video|audio, has vlc, X, flag f = vlc -- "$@"
|
||||
|
||||
#== Documents
|
||||
ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has libreoffice, X, flag f = libreoffice "$@"
|
||||
ext pdf, has zathura, X, flag f = zathura -- "$@"
|
||||
ext djvu, has zathura, X, flag f = zathura -- "$@"
|
||||
ext epub, has zathura, X, flag f = zathura -- "$@"
|
||||
|
||||
#== Images
|
||||
mime ^image/svg, has inkscape, X, flag f = inkscape -- "$@"
|
||||
mime ^image, has feh, X, flag f = feh -- "$@"
|
||||
mime ^image, has ristretto, X, flag f = ristretto "$@"
|
||||
mime ^image, has gimp, X, flag f = gimp -- "$@"
|
||||
ext xcf, X, flag f = gimp -- "$@"
|
||||
|
||||
#== Archives
|
||||
ext 7z, has 7z = 7z -p l "$@" | "$PAGER"
|
||||
ext ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has atool = atool --list --each -- "$@" | "$PAGER"
|
||||
ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has atool = atool --list --each -- "$@" | "$PAGER"
|
||||
ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has atool = atool --extract --each -- "$@"
|
||||
ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has atool = atool --extract --each -- "$@"
|
||||
ext tar|gz|bz2|xz, has tar = tar vvtf "$1" | "$PAGER"
|
||||
ext tar|gz|bz2|xz, has tar = for file in "$@"; do tar vvxf "$file"; done
|
||||
ext bz2, has bzip2 = for file in "$@"; do bzip2 -dk "$file"; done
|
||||
ext zip, has unzip = unzip -l "$1" | less
|
||||
ext zip, has unzip = for file in "$@"; do unzip -d "${file%.*}" "$file"; done
|
||||
ext rar, has unrar = unrar l "$1" | less
|
||||
ext rar, has unrar = for file in "$@"; do unrar x "$file"; done
|
||||
Loading…
Add table
Add a link
Reference in a new issue