From fcb370ba0b16ee888bad5d64ed66c9e3298b2b94 Mon Sep 17 00:00:00 2001 From: Smirnov Alexander Date: Sat, 29 May 2021 12:22:38 +0300 Subject: [PATCH] update, neovim use build-in lsp --- README.md | 11 ++--- config/bspwm/sxhkd | 44 ++++++----------- config/kitty/kitty.conf | 91 +++++++++++++++++++---------------- config/nvim/coc-settings.json | 12 ----- config/nvim/coc.vim | 9 ---- config/nvim/init.vim | 88 +++++++++++++++++++++------------ vscode/settings.json | 6 ++- zshrc | 47 ++++++++---------- 8 files changed, 152 insertions(+), 156 deletions(-) delete mode 100644 config/nvim/coc-settings.json delete mode 100644 config/nvim/coc.vim diff --git a/README.md b/README.md index f7880ee..097cafe 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,5 @@

dotfiles

-![](config/bspwm/screen.png) ----------------------------- - #### System configuration - `OS` Arch - `WM` bspwm @@ -10,7 +7,7 @@ - `Shell` zsh - `Editor` nvim, vscode - `File manager` ranger -- `Browser` firefox +- `Browser` firefox, chrome - `Font` Jatbrains Mono - `Icon font` Font Awesome - `Launcher` rofi @@ -23,12 +20,12 @@ yay -S rcm Install dependency: ```bash -sudo pacman -S neovim tmux git dunst picom bspwm sxhkd kitty rofi zsh ranger ttf-jetbrains-mono ttf-font-awesome -yay -S polybar +sudo pacman -S git bspwm sxhkd dunst kitty picom rofi zsh ranger ttf-font-awesome ttf-jetbrains-mono +yay -S neovim-nightly-bin polybar ``` And install configs: ```bash git clone --recursive https://github.com/Smirnov-O/dotfiles .dotfiles -rcup +rcup rcrc && rcup ``` diff --git a/config/bspwm/sxhkd b/config/bspwm/sxhkd index f337a1b..a9835a7 100644 --- a/config/bspwm/sxhkd +++ b/config/bspwm/sxhkd @@ -1,38 +1,29 @@ -# Smirnov-O -# BSPWM/SXKBD config file - -## == USER keys -super + {_,shift} Return +#== Users hotkeys +super + {_, shift} Return {kitty, rofi -show drun} -super + shift + {w, e, f, s, t, z, q} - {google-chrome-stable, \ - code, \ - nemo, \ - .applications/simplenote.appimage, \ - .applications/todoist.appimage, \ - slock, \ - xkill } +super + shift + {w, e, f, z, q} + {google-chrome-stable, \ + code, \ + nemo, \ + slock, \ + xkill } -{_,shift,ctrl} Print - {scrot -s, \ - scrot, \ - scrot -u } - -super + {equal, minus, shift+minus} +super + {equal, minus, shift + minus} amixer sset Master {2%+, 2%-, toggle} +Print + flameshot gui + super + Escape .config/rofi/script/powermenu.sh -### == BSPWM keys +#== BSPWM super + q bspc node -c super + control + r - bspc wm -r \ - && pkill sxhkd \ - && sxhkd -c ~/.config/bspwm/sxhkd + bspc wm -r && pkill sxhkd && sxhkd -c ~/.config/bspwm/sxhkd super + {_,shift + } {h,j,k,l} bspc node -{f,s} {west,south,north,east} @@ -43,10 +34,7 @@ super + ctrl + {h,j,k,l} super + {_,shift + }{1-9} bspc {desktop -f,node -d} focused:'^{1-9}' -super + shift + {Tab, F11} - bspc node -t {floating,fullscreen} - -super + Tab - bspc node -t tiled +super + {t, f, e} + bspc node -t {tiled, floating, fullscreen} # vim: ft=sxhkdrc diff --git a/config/kitty/kitty.conf b/config/kitty/kitty.conf index 482c573..9226cb8 100644 --- a/config/kitty/kitty.conf +++ b/config/kitty/kitty.conf @@ -1,48 +1,55 @@ font_family JetBrains Mono disable_ligatures always -font_size 11 -repaint_delay 10 - -# Cursor -cursor_text_color #4c566a -cursor_shape underline -cursor_underline_thickness 1.3 +enable_audio_bell no +open_url_modifiers ctrl cursor_blink_interval 0 -# Bell -enable_audio_bell no -window_alert_on_bell no -bell_on_tab no +## HotKeys +map ctrl+equal change_font_size all +2 +map ctrl+minus change_font_size all -2 +map ctrl+backspace change_font_size all 0 -# Keyboard Shortcuts -clear_all_shortcuts yes -open_url_modifiers ctrl -map ctrl+shift+c copy_to_clipboard -map ctrl+shift+v paste_from_clipboard -map ctrl+shift+u kitten unicode_input -map alt+k scroll_line_up -map alt+j scroll_line_down -map ctrl+equal change_font_size all +2.0 -map ctrl+minus change_font_size all -2.0 -map ctrl+backspace change_font_size all 0 +## Theme +#selection_background #303030 +#selection_foreground #202020 +#background #202020 +#foreground #d0d0d0 +#cursor #d0d0d0 +#color0 #151515 +#color8 #505050 +#color1 #ac4142 +#color9 #ac4142 +#color2 #7e8d50 +#color10 #7e8d50 +#color3 #e5b566 +#color11 #e5b566 +#color4 #6c99ba +#color12 #6c99ba +#color5 #9e4e85 +#color13 #9e4e85 +#color6 #7dd5cf +#color14 #7dd5cf +#color7 #d0d0d0 +#color15 #f5f5f5 +color0 #232323 +color1 #ff000f +color2 #8ce10b +color3 #ffb900 +color4 #008df8 +color5 #6d43a6 +color6 #00d8eb +color7 #ffffff +color8 #444444 +color9 #ff2740 +color10 #abe15b +color11 #ffd242 +color12 #0092ff +color13 #9a5feb +color14 #67fff0 +color15 #ffffff +background #0e1019 +selection_foreground #0e1019 +cursor #ff0018 +foreground #fffaf4 +selection_background #fffaf4 -# Theming -background #f6f6f6 -foreground #2a2b33 -cursor #d8dee9 -color0 #3b4252 -color8 #4c566a -color1 #bf616a -color9 #bf616a -color2 #a3be8c -color10 #a3be8c -color3 #ebcb8b -color11 #ebcb8b -color4 #81a1c1 -color12 #81a1c1 -color5 #b48ead -color13 #b48ead -color6 #88c0d0 -color14 #88c0d0 -color7 #e5e9f0 -color15 #e5e9f0 diff --git a/config/nvim/coc-settings.json b/config/nvim/coc-settings.json deleted file mode 100644 index 8228fb5..0000000 --- a/config/nvim/coc-settings.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "javascript.suggestionActions.enabled": false, - "html.filetypes": ["ejs", "jst"], - "languageserver": { - "golang": { - "filetypes": ["go"], - "command": "gopls", - "rootPatterns": ["go.mod"], - "disableWorkspaceFolders": true - } - } -} diff --git a/config/nvim/coc.vim b/config/nvim/coc.vim deleted file mode 100644 index a96f1ab..0000000 --- a/config/nvim/coc.vim +++ /dev/null @@ -1,9 +0,0 @@ -ino pumvisible() ? "\" : "\" -ino pumvisible() ? "\" : "\" -map s (coc-rename) - -let g:coc_global_config = "$HOME/.config/nvim/coc-settings.json" -let g:coc_global_extensions = [ -\ "coc-tsserver", -\ "coc-html" -\ ] diff --git a/config/nvim/init.vim b/config/nvim/init.vim index ca8cad1..c1eba67 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -1,25 +1,31 @@ call plug#begin('~/.vim/plugged') - Plug 'Smirnov-O/nten.vim' - Plug 'jiangmiao/auto-pairs' Plug 'sheerun/vim-polyglot' - Plug 'neoclide/coc.nvim' - Plug 'axvr/zepl.vim' + " Completion && LSP + Plug 'neovim/nvim-lspconfig' + Plug 'hrsh7th/nvim-compe' + Plug 'jiangmiao/auto-pairs' + " Status line + Plug 'hoob3rt/lualine.nvim' + " Theme + Plug 'Smirnov-O/nten.vim' call plug#end() "== General -colo nten-light " Color scheme -set nu rnu cul " Line numbers & cursor highlight -set lbr wrap " Line wrap -set mouse=a mousehide " Mouse -set ruler laststatus=0 " Status line -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 nobk noswf noudf " Swap files -set is ic scs " Search +colo codedark " Color scheme +set termguicolors " GUI colors +set nu rnu cul " Line numbers & cursor 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 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:· @@ -28,6 +34,34 @@ set list listchars=tab:\|·,trail:~,space:· set ts=4 sw=4 sts=4 set sta et ai +"== Status line +lua require'lualine'.setup({options = { +\ theme = "codedark" +\ }}) + +"== Completion(LSP) +ino pumvisible() ? "\" : "\" +ino pumvisible() ? "\" : "\" +ino compe#confirm('') +nno sr :lua vim.lsp.buf.rename() +nno sh :lua vim.lsp.buf.hover() +nno si :lua vim.lsp.buf.definition() +nno sa :lua vim.lsp.buf.code_action() + +lua << EOF +require'lspconfig'.tsserver.setup{} +require'lspconfig'.gopls.setup{} +require'compe'.setup{ + enabled = true, + autocomplete = true, + source = { + path = true, + buffer = true, + nvim_lsp = true, + } +} +EOF + "== Netrw file tree let g:netrw_liststyle = 3 let g:netrw_banner = 0 @@ -36,37 +70,31 @@ 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 go setl noet sw=4 ts=4 "== Custom commands -com! -nargs=1 REpl :cal zepl#start("")|winc L|se nonu nornu com! Prettier :sil !prettier -w % -com! Term :vs|winc L|se nonu nornu|term +com! Term :vs|winc L|se nonu nornu|start|term com! GoFmt :sil !gofmt -w % com! Black :sil !black % "== Mapping -let mapleader=";" - -nn :w +nn :w nn :noh -tno - +tno nn t :Term -nn r :REpl nn e :Ex nn j :bn nn k :bp nn w :bd +nn ; :FZF nn :wincmd h nn :wincmd j nn :wincmd k nn :wincmd l -nn cpp :ReplSend -vn cpp :ReplSend nn spv :vs nn sph :sp - -"== LSP(coc) -so $HOME/.config/nvim/coc.vim +nn spk :winc K +nn spl :winc L diff --git a/vscode/settings.json b/vscode/settings.json index 61df50f..0350dd4 100644 --- a/vscode/settings.json +++ b/vscode/settings.json @@ -1,7 +1,7 @@ { "editor.fontFamily": "'Jetbrains Mono', 'Droid Sans Mono', 'monospace'", "workbench.colorTheme": "Brackets Light Pro", - "workbench.panel.defaultLocation": "right", + "workbench.panel.defaultLocation": "bottom", "workbench.sideBar.location": "right", "editor.wordWrap": "off", "editor.fontSize": 14, @@ -22,6 +22,8 @@ "prettier.semi": false, "tabnine.experimentalAutoImports": true, + "html.format.enable": false, + "emmet.includeLanguages": { "javascript": "javascriptreact" @@ -32,5 +34,5 @@ "[javascriptreact]":{ "editor.defaultFormatter": "esbenp.prettier-vscode", }, - "html.format.enable": false, + "workbench.startupEditor": "none" } diff --git a/zshrc b/zshrc index 38921fb..f8d5f1e 100644 --- a/zshrc +++ b/zshrc @@ -1,33 +1,28 @@ -export PATH="$HOME/bin:$HOME/.local/bin:$HOME/.golang/bin:$HOME/go/bin:$PATH" -export GOPATH="$HOME/go" -export EDITOR="nvim" - -### StartShip +## StartShip eval "$(starship init zsh)" -### FzF -export FZF_DEFAULT_COMMAND="rg --files --ignore-vcs" +## Variables +export GOPATH="$HOME/go" +export EDITOR="nvim" +export PATH="$HOME/bin:$HOME/.local/bin:$HOME/.golang/bin:$GOPATH/bin:$PATH" -### Oh my zsh +## Oh my zsh export OMH="$HOME/.oh-my-zsh" # ZSH_THEME="simple" -DISABLE_AUTO_TITLE="true" -plugins=(docker nvm npm) +plugins=(dotenv) source $OMH/oh-my-zsh.sh -### Aliases -alias cls="clear" -alias mkdir="mkdir -p" -alias cp="cp -r" -alias vim="nvim" -alias vi="vim" -alias tmux="tmux -2" -alias e="$EDITOR" -alias :q="exit" -alias ...="cd ../.." -alias .3="cd ../../.." -alias gog="go get" -alias gor="go run" -alias gob="go build" -alias pacs="sudo pacman -S" -alias pacr="sudo pacman -R" +## HotKets +bindkey -s "^o" "ranger\n" +bindkey -s "^v" 'nvim $(fzf)\n' +bindkey -s "^f" 'cd $(fd -t directory | fzf)\n' + +## FNM +eval $(fnm env) + +## Aliases +alias cls="clear" cp="cp -r" mkdir="mkdir -p" +alias vim="nvim" vi="vim" e="$EDITOR" +alias ...="cd ../.." .3="cd ../../.." .4="cd ../../../.." +alias gor="go run" gob="go build" gog="go get" goi="go install" +alias pac="sudo pacman" pacs="pac -S" pacr="pac -R" pacss="pac -Ss"