update, neovim use build-in lsp

This commit is contained in:
Smirnov Alexander 2021-05-29 12:22:38 +03:00
parent 8aa92b589f
commit fcb370ba0b
8 changed files with 152 additions and 156 deletions

View file

@ -1,8 +1,5 @@
<h1 align="center">dotfiles</h1>
![](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
```

View file

@ -1,38 +1,29 @@
# Smirnov-O <ss2316544@gmail.com>
# 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}
super + shift + {w, e, f, z, q}
{google-chrome-stable, \
code, \
nemo, \
.applications/simplenote.appimage, \
.applications/todoist.appimage, \
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

View file

@ -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
# 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
## 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
# 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
## 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

View file

@ -1,12 +0,0 @@
{
"javascript.suggestionActions.enabled": false,
"html.filetypes": ["ejs", "jst"],
"languageserver": {
"golang": {
"filetypes": ["go"],
"command": "gopls",
"rootPatterns": ["go.mod"],
"disableWorkspaceFolders": true
}
}
}

View file

@ -1,9 +0,0 @@
ino <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
ino <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
map <leader>s <Plug>(coc-rename)
let g:coc_global_config = "$HOME/.config/nvim/coc-settings.json"
let g:coc_global_extensions = [
\ "coc-tsserver",
\ "coc-html"
\ ]

View file

@ -1,17 +1,21 @@
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
colo codedark " Color scheme
set termguicolors " GUI colors
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 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
@ -20,6 +24,8 @@ 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 <expr> <tab> pumvisible() ? "\<C-n>" : "\<tab>"
ino <expr> <s-tab> pumvisible() ? "\<C-p>" : "\<tab>"
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>
nno sa :lua vim.lsp.buf.code_action()<cr>
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("<args>")|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 <C-s> :w<cr>
nn <space> :noh<cr>
tno <esc> <c-\><c-n>
nn <leader>t :Term<cr>
nn <leader>r :REpl<space>
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 cpp :ReplSend<cr>
vn cpp :ReplSend<cr>
nn spv :vs<cr>
nn sph :sp<cr>
"== LSP(coc)
so $HOME/.config/nvim/coc.vim
nn spk :winc K<cr>
nn spl :winc L<cr>

View file

@ -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"
}

47
zshrc
View file

@ -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"