diff options
| -rw-r--r-- | .config/shell/.zshrc | 10 | ||||
| -rw-r--r-- | .config/shell/aliasrc | 1 | ||||
| -rw-r--r-- | .config/shell/envvarrc | 4 | ||||
| -rw-r--r-- | .config/vim/.vimrc | 40 |
4 files changed, 39 insertions, 16 deletions
diff --git a/.config/shell/.zshrc b/.config/shell/.zshrc index 3e00ea5..6c32a86 100644 --- a/.config/shell/.zshrc +++ b/.config/shell/.zshrc @@ -89,17 +89,10 @@ htop_widget() { zle accept-line } -notesplain_widget() { - zle -I - BUFFER="notesplain" - zle accept-line -} - # Register it as a ZLE widget zle -N lfcd_widget zle -N gitui_widget zle -N htop_widget -zle -N notesplain_widget # Bind it in both vi keymaps bindkey -M viins '^o' lfcd_widget @@ -111,9 +104,6 @@ bindkey -M vicmd '^g' gitui_widget bindkey -M viins '^t' htop_widget bindkey -M vicmd '^t' htop_widget -bindkey -M viins '^n' notesplain_widget -bindkey -M vicmd '^n' notesplain_widget - # Use vim keys in tab complete menu: bindkey -M menuselect 'h' vi-backward-char bindkey -M menuselect 'k' vi-up-line-or-history diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index 0a627b0..abcb471 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -56,6 +56,7 @@ alias \ bd="buku-dmenu" \ copy="xsel -ib" \ fd="fdfind" \ + ipy="ipython3" \ lw="librewolf & exit -f" \ nbadd='cat >> "$XDG_CONFIG_HOME"/newsboat/urls << EOF' \ py="python3" \ diff --git a/.config/shell/envvarrc b/.config/shell/envvarrc index dab4f7a..794557a 100644 --- a/.config/shell/envvarrc +++ b/.config/shell/envvarrc @@ -4,7 +4,7 @@ # Primary programs export BROWSER="librewolf" export EDITOR="vim" -export IMAGE_VIEWER="sxiv" +export IMAGE_VIEWER="feh" export MANPAGER="vim -M +MANPAGER -" export SHELL="/usr/bin/zsh" export TERMINAL="st" @@ -24,6 +24,8 @@ export ENVVARRC="$HOME/.config/shell/envvarrc" export CONDARC="$HOME/.config/conda/.condarc" export _CONDA_ROOT="$HOME/.local/opt/miniconda3" export GOPATH="$HOME/langs/go" +export IPYTHONDIR="$HOME/.config/ipython" +export OBSIDIAN_HOME="$HOME/.cache/obsidian" export STARDICT_DATA_DIR="$HOME/.local/share/stardict" export R_HISTFILE="$HOME/langs/R/.Rhistory" export R_HOME="$HOME/langs/R" diff --git a/.config/vim/.vimrc b/.config/vim/.vimrc index 2bad7b5..3236d87 100644 --- a/.config/vim/.vimrc +++ b/.config/vim/.vimrc @@ -23,6 +23,8 @@ set autoindent " Enable automatic indentation set cindent " Enable C-style indentation set smartindent " Enable smart indentation (e.g., after braces) set nowrap " Disable line wrapping +set scrolloff=8 " Keep the cursor in the middle +set completeopt=menuone,noinsert " Make autocomplete in Python usable " Clipboard and mouse set clipboard+=unnamedplus " Enable clipboard integration with system clipboard @@ -37,8 +39,8 @@ set runtimepath^=$HOME/.config/vim/.vim " Add custom runtime path for plugins an " Miscellaneous settings set go=a " Enable all automatic formatting options -set spelllang=en -set nospell +set spelllang=en,pl +colorscheme pablo " Change colorscheme " Use pathogen (plugin manager) filetype off @@ -75,7 +77,7 @@ nnoremap <space> i<space><esc> nnoremap <silent> <F7> :tabnew ~/.vimrc<CR> nnoremap <silent> <F8> :TlistToggle<CR> nnoremap <silent> <F9> :NERDTree<CR> -inoremap <Space><Space> <Esc>/<++><CR>"_c4l +" inoremap <Space><Space> <Esc>/<++><CR>"_c4l vnoremap <C-J> "+y " show existing tab with 4 spaces width @@ -93,6 +95,9 @@ autocmd Filetype rmd map <F5> :!echo<space>"require(rmarkdown);<space>render('<c " Automatically use black on a Python file autocmd BufWritePost *.py !black --line-length=79 % +" Run .py files automatically +autocmd FileType python map <F5> :w<CR>:!python3 %<CR> + " Pymode config let g:pymode = 1 let g:pymode_warnings = 0 @@ -104,5 +109,30 @@ let g:pymode_indent = 1 let g:pymode_indent_hanging_width = &shiftwidth let g:pymode_indent_hanging_width = 4 let g:pymode_doc = 1 - -let maplocalleader = "," +let g:pymode_doc_bind = 'K' +let g:pymode_rope = 1 +let g:pymode_rope_autoimport = 1 +let g:pymode_rope_lookup_project = 1 +let g:pymode_rope_project_root = "." +let g:pymode_rope_folder = ".ropeproject" +let g:pymode_rope_completion = 1 +let g:pymode_rope_complete_on_dot = 1 + +let maplocalleader = '\' + +" fzy integration +function! FzyCommand(choice_command, vim_command) + try + let output = system(a:choice_command . " | fzy ") + catch /Vim:Interrupt/ + " Swallow errors from ^C, allow redraw! below + endtry + redraw! + if v:shell_error == 0 && !empty(output) + exec a:vim_command . ' ' . output + endif +endfunction + +nnoremap <leader>e :call FzyCommand("ag . --silent -l -g ''", ":e")<cr> +nnoremap <leader>v :call FzyCommand("ag . --silent -l -g ''", ":vs")<cr> +nnoremap <leader>s :call FzyCommand("ag . --silent -l -g ''", ":sp")<cr> |
