diff options
Diffstat (limited to '.config/vim')
| -rw-r--r-- | .config/vim/.vimrc | 40 |
1 files changed, 35 insertions, 5 deletions
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> |
