diff --git a/tmux.conf b/tmux.conf index 7e07ece..03c1b72 100644 --- a/tmux.conf +++ b/tmux.conf @@ -6,6 +6,7 @@ set-window-option -g automatic-rename off set-window-option -g allow-rename off set-option -g set-titles on +set-window-option -g mode-keys vi set -g status-keys vi set -g history-limit 10000 set -g escape-time 0 diff --git a/vimrc b/vimrc index 43de952..20d636d 100644 --- a/vimrc +++ b/vimrc @@ -1,13 +1,14 @@ syntax on filetype plugin indent on -" Make comma the leader key let mapleader="," -" file browser +" netrw let g:netrw_banner = 0 let g:netrw_liststyle = 1 let g:netrw_list_hide = '^\.' +let g:netrw_winsize=25 +map n :Lexplore set shiftwidth=2 set shiftround @@ -18,7 +19,7 @@ set encoding=utf-8 set nocompatible set t_Co=256 set hidden -set history=100 +set history=1000 set nowrap set smartindent set copyindent @@ -43,7 +44,6 @@ set noerrorbells set nobackup set noswapfile set clipboard=unnamed -set pastetoggle= set ttymouse=sgr set mouse=a set mousemodel=popup_setpos @@ -53,9 +53,13 @@ set timeoutlen=600 set ballooneval set balloonevalterm set scrolloff=5 +set dict=/usr/share/dict/words +set shortmess+=I +" See :help thesaurus +set thesaurus=$HOME/Documents/thesaurus/thesaurus_pkg/thesaurus.txt " Colour scheme: -colorscheme PaperColor +colorscheme iceberg set background=dark " Key mappings: @@ -66,22 +70,46 @@ map map map map -map n :Ntree map :tabnew " Select just-pasted text: -nnoremap p `[v`] +nnoremap 0 `[v`] nnoremap Q @@ +map p :set pastea +map P :set nopaste + + +function! ToggleQuickFix() + if empty(filter(getwininfo(), 'v:val.quickfix')) + copen + else + cclose + endif +endfunction +map q :call ToggleQuickFix() " vim-markdown configuration: let g:vim_markdown_conceal = 3 " Command-T configuration: +let switchbuf="usetab" map T :CommandTFlush +map r :CommandTMRU +map H :CommandTHelp +map c :CommandTCommand +map m :marks +map R :registers +map v :vsplit +map h :splitfile browser +map ! :only let g:CommandTFileScanner="git" let g:CommandTGitScanSubmodules=1 let g:CommandTGitIncludeUntracked=1 let g:CommandTMatchWindowAtTop=0 -let g:CommandTMaxHeight=10 +let g:CommandTMaxHeight=20 +" See :h command-t-faq +if &term =~ "xterm" || &term =~ "screen" + let g:CommandTCancelMap = ['', ''] +end " Lightline configuration: set laststatus=2 @@ -125,7 +153,10 @@ map f :ALEFindReferences map fv :ALEFindReferences -vsplit map fh :ALEFindReferences -split map ft :ALEFindReferences -tab -map r :ALERename +command GoToDefinition ALEGoToDefinition +command GoToTypeDefinition ALEGoToTypeDefinition +command FindReferences ALEFindReferences +command Rename ALERename let g:ale_sign_column_always = 1 let g:ale_fix_on_save = 1 @@ -140,7 +171,7 @@ let g:ale_set_balloons = 1 let g:ale_rust_analyzer_config = { \ 'diagnostics': { 'disabled': ['unresolved-import'] }, \ 'cargo': { 'loadOutDirsFromCheck': v:true }, - \ 'procMacro': { 'enable': v:false }, + \ 'procMacro': { 'enable': v:true }, \ 'checkOnSave': { 'command': 'clippy', 'enable': v:true }, \ } let g:ale_go_goimports_options = '-local github.com/sensiblecodeio/cantabular' @@ -153,13 +184,15 @@ let g:ale_history_log_output = 1 let g:ale_linters = { \ 'javascript': ['eslint'], \ 'go': ['gopls'], - \ 'rust': ['analyzer'] + \ 'rust': ['analyzer'], + \ 'css': ['stylelint'], \ } let g:ale_fixers = { \ '*': ['remove_trailing_lines', 'trim_whitespace'], \ 'javascript': ['prettier'], \ 'rust': [], - \ 'go': [] + \ 'go': [], + \ 'css': ['stylelint'], \ } " load ALE only after configured: diff --git a/zshrc b/zshrc index cbfcc85..5ed1fc6 100644 --- a/zshrc +++ b/zshrc @@ -146,3 +146,11 @@ fi # For Ubuntu, disable Caps-Lock: setxkbmap -option caps:none + +# Vim keymap +bindkey -v +bindkey '^P' up-history +bindkey '^N' down-history +bindkey '^w' backward-kill-word +bindkey '^r' history-incremental-search-backward +export KEYTIMEOUT=2