From 867f7b8c3b65e188c365781d699503abed33c7af Mon Sep 17 00:00:00 2001 From: Mike Cugini Date: Sun, 6 Dec 2020 17:32:18 -0500 Subject: [PATCH] another update for vim and i3 --- Xresources | 2 +- i3/config | 39 +++++++------ i3/i3status.conf | 19 ++++++- vimrc | 144 ++++++++++++++++++++++++++--------------------- zshrc | 15 ++++- 5 files changed, 128 insertions(+), 91 deletions(-) diff --git a/Xresources b/Xresources index bcb9fc2..edd7a50 100644 --- a/Xresources +++ b/Xresources @@ -1,5 +1,5 @@ ! DPI settings -Xft.dpi: 276 +!Xft.dpi: 276 !Xft.dpi: 220 Xft.autohint: 0 Xft.lcdfilter: lcddefault diff --git a/i3/config b/i3/config index 8d898c9..03e62dc 100644 --- a/i3/config +++ b/i3/config @@ -11,20 +11,19 @@ set $mod Mod4 -exec --no-startup-id /usr/bin/unity-settings-daemon -exec xrandr --dpi 200 #109 #200 # 163 -exec compton -CGb -exec --no-startup-id feh --bg-fill ~/Pictures/dark_spots_texture_background_50355_3840x2160.jpg -exec --no-startup-id "xautolock -time 10 -locker 'i3lock -e -i /home/cugini/Pictures/dark_spots_texture_background_50355_3840x2160.png'" -exec synclient TapButton3=2 ClickFinger3=2 -exec --no-startup-id nm-applet +# exec picom -CGb exec --no-startup-id udiskie -t +exec --no-startup-id pasystray exec --no-startup-id dropbox start +exec --no-startup-id protonmail-bridge --no-window +exec --no-startup-id /home/mike/bin/vorta # Font for window titles. Will also be used by the bar unless a different font # is used in the bar {} block below. #font pango:M+ 1m, FontAwesome, monospace 8 -font pango:M+ 1m, FontAwesome, Monotype Noto Sans 8 +font pango:M+ 1m, FontAwesome, Noto Sans 8 + +new_window 1pixel # This font is widely installed, provides lots of unicode glyphs, right-to-left # text rendering and scalability on retina/hidpi displays (thanks to pango). @@ -35,18 +34,14 @@ floating_modifier $mod # start a terminal #bindsym $mod+Return exec i3-sensible-terminal -bindsym $mod+Return exec st +bindsym $mod+Return exec alacritty # kill focused window bindsym $mod+Shift+q kill # start dmenu (a program launcher) -bindsym $mod+d exec dmenu_run -fn 'Monotype Noto Sans-10' -#bindsym $mod+d exec --no-startup-id i3-dmenu-desktop --dmenu="dmenu_run -fn 'Monotype Noto Sans-8'" -# There also is the (new) i3-dmenu-desktop which only displays applications -# shipping a .desktop file. It is a wrapper around dmenu, so you need that -# installed. -# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop +# bindsym $mod+d exec dmenu_run -fn 'Noto Sans-10' +bindsym $mod+d exec rofi -modi run -show run # change focus bindsym $mod+h focus left @@ -78,6 +73,8 @@ bindsym $mod+Shift+Right move right # split in vertical orientation bindsym $mod+v split v +bindsym $mod+Shift+w sticky toggle + # enter fullscreen mode for the focused container bindsym $mod+f fullscreen toggle @@ -170,11 +167,13 @@ mode "resize" { #bindsym $mod+r mode "resize" +for_window [class="Keybase"] move position mouse + # Start i3bar to display a workspace bar (plus the system information i3status # finds out, if available) bar { - #status_command i3status - status_command i3status | ~/bin/my_i3status.py + status_command i3status + # status_command i3status | ~/bin/my_i3status.py } bindsym XF86AudioPlay exec playerctl play-pause && killall -USR1 i3status @@ -190,7 +189,7 @@ bindsym XF86AudioLowerVolume exec ~/bin/lower_volume && killall -USR1 i3status bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle && killall -USR1 i3status #lock and suspend -#bindsym $mod+p exec i3lock +bindsym $mod+p exec i3lock # bindsym $mod+p exec xdg-screensaver lock -bindsym $mod+p exec dm-tool lock -bindsym $mod+Shift+p exec systemctl suspend +# bindsym $mod+p exec dm-tool lock +# bindsym $mod+Shift+p exec systemctl suspend diff --git a/i3/i3status.conf b/i3/i3status.conf index 9ff0134..13befa1 100644 --- a/i3/i3status.conf +++ b/i3/i3status.conf @@ -12,13 +12,14 @@ general { interval = 5 } -order += "volume master" +#order += "volume master" +order += "volume komplete" order += "disk /" #order += "run_watch DHCP" order += "path_exists VPN" order += "wireless _first_" order += "ethernet _first_" -order += "battery 0" +#order += "battery 0" order += "load" order += "tztime local" order += "tztime utc" @@ -31,6 +32,20 @@ volume master { mixer_idx = 0 } +volume komplete { + format = " %volume" + format_muted = " %volume" + device = "pulse:alsa_output.usb-Native_Instruments_Komplete_Audio_2_00000181-00.analog-stereo" +} + +# volume komplete { +# format = " %volume" +# format_muted = " %volume" +# #device = "hw:2" +# device = "hw:0" +# mixer = "Komplete Audio 2 " +# } + wireless _first_ { #format_up = "W: (%quality at %essid) %ip" #format_down = "W: down" diff --git a/vimrc b/vimrc index d0929fc..71bb08d 100644 --- a/vimrc +++ b/vimrc @@ -1,25 +1,57 @@ call plug#begin('~/.local/share/nvim/plugged') +" general dev tools Plug 'w0rp/ale' - Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } Plug 'junegunn/fzf.vim' +Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } +Plug 'LnL7/vim-nix' -Plug 'morhetz/gruvbox' - +" go tools Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' } -Plug 'hdima/python-syntax' - +" rust tools Plug 'rust-lang/rust.vim' +" Plug 'racer-rust/vim-racer' +" reason/bucklescript +Plug 'reasonml-editor/vim-reason-plus' + +" git Plug 'mhinz/vim-signify' Plug 'tpope/vim-fugitive' +" beautify +Plug 'morhetz/gruvbox' Plug 'vim-airline/vim-airline' +Plug 'liuchengxu/space-vim-theme' -call plug#end() +" python tools +" Plug 'deoplete-plugins/deoplete-jedi' +" Plug 'davidhalter/jedi-vim' +" Plug 'hdima/python-syntax' +Plug 'vim-python/python-syntax' +" elm tools +Plug 'andys8/vim-elm-syntax' + +" Javascript +Plug 'yuezk/vim-js' +Plug 'maxmellon/vim-jsx-pretty' + +" lisps +Plug 'wlangstroth/vim-racket' +Plug 'junegunn/rainbow_parentheses.vim' + +" notes and organization +Plug 'vimwiki/vimwiki' + +Plug 'autozimu/LanguageClient-neovim', { + \ 'branch': 'next', + \ 'do': 'bash install.sh', + \ } + +call plug#end() set nocompatible set encoding=utf-8 @@ -36,10 +68,8 @@ if has("termguicolors") endif set background=dark -"colorscheme molokai "gruvbox zenburn -" colorscheme material-monokai -"let g:molokai_original = 1 -colorscheme gruvbox +" colorscheme gruvbox +colorscheme space_vim_theme "always show status bar set laststatus=2 @@ -52,8 +82,9 @@ filetype plugin indent on "indent and tab set nowrap set expandtab -set tabstop=4 shiftwidth=4 softtabstop=4 set backspace=indent,eol,start +set tabstop=4 shiftwidth=4 softtabstop=4 +autocmd FileType javascript setlocal shiftwidth=2 softtabstop=2 "turn paste mode on and off with F3 set pastetoggle= @@ -68,10 +99,6 @@ set smartcase set wildmenu set wildmode=longest:full,full -"configure code folding bindings -nnoremap za -vnoremap zf - "Better split navigation nnoremap nnoremap @@ -85,56 +112,58 @@ set splitright if executable('rg') let g:ctrlp_user_command = 'rg --files %s' set grepprg=rg\ --no-heading\ --vimgrep\ --smart-case -elseif executable('ag') - let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""' - set grepprg=ag\ --nogroup\ --nocolor endif " vim-signify let g:signify_vcs_list = [ 'git', 'hg' ] let g:signify_sign_change = "~" +" clojureee +au FileType clojure RainbowParentheses "Go specific settings -set rtp+=$GOROOT/misc/vim au BufRead,BufNewFile *.go set list noexpandtab syntax=go listchars=tab:\|\ ,trail:- -autocmd FileType go map :GoDoc - -" FZF -set rtp+=$HOME/.fzf -command! -bang -nargs=* RgFzf - \ call fzf#run(fzf#wrap('rgfzf', {'source': "rg --files"}, 0)) -" nmap :Files -nmap :RgFzf -nnoremap b :Buffers -nnoremap g :Rg -nnoremap l :BLines -nnoremap c :Commands - -" use ripgrep instead of ag/grep -command! -bang -nargs=* Rg - \ call fzf#vim#grep( - \ 'rg --column --line-number --no-heading --color=always '.shellescape(), 1, - \ 0 ? fzf#vim#with_preview('up:60%') - \ : fzf#vim#with_preview('right:50%:hidden', '?'), - \ 0) - -function! InsertTabWrapper() + +" YAML +autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab + +function! CleverTab() if pumvisible() - return "\" + return "\" endif - let col = col('.') - 1 - if !col || getline('.')[col - 1] !~ '\k' - return "\" + if strpart( getline('.'), 0, col('.')-1 ) =~ '^\s*$' + return "\" + elseif exists('&omnifunc') && &omnifunc != '' + return "\\" else - return "\\" + return "\" endif endfunction -inoremap InsertTabWrapper() -inoremap pumvisible()?"\":"\" + +inoremap =CleverTab() +inoremap pumvisible() ? "\" : "\" +inoremap pumvisible() ? "\" : "\" + +" inoremap pumvisible() ? "\" : "\" +" inoremap pumvisible() ? "\" : "\" +" inoremap pumvisible() ? "\" : "\" + +let g:ale_fixers = { + \ 'javascript': ['prettier', 'eslint'], + \ 'python': ['black'], + \ } + +let g:LanguageClient_serverCommands = { + \ 'rust': ['rust-analyzer'], + \ 'python': ['/usr/local/bin/pyls'], + \ 'reason': ['/home/mike/bin/reason-language-server'], + \ 'javascript': ['/usr/bin/javascript-typescript-stdio'], + \ } + +let g:python_highlight_all = 1 let g:go_fmt_command = "goimports" -let g:syntastic_go_checkers = ['go', 'goimports', 'govet', 'golint'] +let g:go_doc_popup_window = 1 let g:go_highlight_functions = 1 let g:go_highlight_function_calls = 1 @@ -150,26 +179,11 @@ let g:go_highlight_build_constraints = 1 " disable vim-jedi autocomplete as we get it with deoplete-jedi " but we want all the other functionality let g:jedi#completions_enabled = 0 -let g:jedi#use_splits_not_buffers = 'winwidth' +" let g:jedi#use_splits_not_buffers = 'winwidth' " deoplete configuration let g:deoplete#enable_at_startup = 1 -" deoplete Go -let g:deoplete#sources#go#sort_class = ['package', 'func', 'type', 'var', 'const'] -let g:deoplete#sources#go#gocode_binary = '/home/cugini/go/bin/gocode' -let g:deoplete#sources#go#use_cache = 1 -let g:deoplete#sources#go#json_directory = '~/.cache/deoplete/go/$GOOS_$GOARCH' - -" deoplete Rust -let g:deoplete#sources#rust#racer_binary = '/home/cugini/.cargo/bin/racer' -let g:deoplete#sources#rust#rust_source_path = '/home/cugini/Projects/rust/src' - -"configure tagbar -nmap :TagbarToggle -let g:tagbar_width = 60 -let g:tagbar_sort = 0 - if filereadable(expand("~/.vim/local.vim")) source ~/.vim/local.vim endif diff --git a/zshrc b/zshrc index d8c759e..1ea22b7 100644 --- a/zshrc +++ b/zshrc @@ -1,5 +1,6 @@ # load my zsh configs source ~/.zsh/load.sh +source ~/.nix-profile/etc/profile.d/nix.sh # turn off mostly unhelpful autocorrect unsetopt correct_all @@ -34,10 +35,18 @@ alias la='ls -a' bindkey '^R' history-incremental-search-backward export GOPATH=$HOME/Projects/go +export RUST_SRC_PATH=$HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src -export PATH=$HOME/bin:$GOPATH/bin:$PATH -export PATH=/home/mike/.gem/ruby/2.3.0/bin:$PATH -export PATH=/opt/android-studio/bin:/home/mike/.cargo/bin:$PATH +export PATH=$HOME/bin:$HOME/.local/bin:$PATH # user custom bins +export PATH=$GOPATH/bin:$PATH # go bin +export PATH=$HOME/.gem/ruby/2.3.0/bin:$PATH # ruby gem bin +export PATH=$HOME/.cargo/bin:$PATH # rust cargo bin +export PATH=$HOME/Android/Sdk/platform-tools:$PATH # android studio bin +export PATH=$HOME/.poetry/bin:$PATH # android studio bin # source zsh-syntax-highlighting last source $ZSH/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +source /usr/share/fzf/key-bindings.zsh +eval "$(direnv hook zsh)" + +[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh