diff options
| author | Andrew Guschin <guschin.drew@gmail.com> | 2022-02-20 10:33:45 +0400 |
|---|---|---|
| committer | Andrew Guschin <guschin.drew@gmail.com> | 2022-02-20 10:33:45 +0400 |
| commit | 97b7e5b9191ad507fdb071857c5d05accf407dda (patch) | |
| tree | a60994bc6c32ff87003c00695a64be00bdc51e54 /.config | |
| parent | e102187d33fb5ee21ca9d6d2cf50f5f2404e8050 (diff) | |
Moved vim config into .config/vim and changed plugin manager to vim-plug
Diffstat (limited to '.config')
| -rw-r--r-- | .config/nvim/autoload/projector.vim | 42 | ||||
| -rw-r--r-- | .config/vim/init.vim (renamed from .config/nvim/init.vim) | 35 |
2 files changed, 18 insertions, 59 deletions
diff --git a/.config/nvim/autoload/projector.vim b/.config/nvim/autoload/projector.vim deleted file mode 100644 index 9c60055..0000000 --- a/.config/nvim/autoload/projector.vim +++ /dev/null @@ -1,42 +0,0 @@ -" Allows per-project configuration of keybindings. -" For example, '*.cpp <F5> make' will run make on F5 button push -" if .cpp file was opened -let s:commandFormat="au BufReadPost,BufNewFile %s map %s :!%s<CR>" - -" Files that plugin searches on startup (relative to pwd) -let s:allowedConfigPaths=[".vim/config", ".vim.conf", "vim.conf"] - -function! s:createCommand(line) - let line=split(a:line) - return printf(s:commandFormat, line[0], line[1], join(line[2:])) -endfunction - -function! s:parseFile(filename) - let commands=[] - for line in readfile(a:filename) - let commands=commands + [s:createCommand(line)] - endfor - return commands -endfunction - -function! s:getConfigs() - let commands=[] - for filename in s:allowedConfigPaths - if filereadable(filename) - let commands=commands + s:parseFile(filename) - endif - endfor - return commands -endfunction - -function! s:applyConfig(config) - for line in a:config - execute line - endfor -endfunction - -function! projector#init() - let config=s:getConfigs() - call s:applyConfig(config) -endfunction - diff --git a/.config/nvim/init.vim b/.config/vim/init.vim index 41012e8..31f5f93 100644 --- a/.config/nvim/init.vim +++ b/.config/vim/init.vim @@ -1,15 +1,11 @@ set nocompatible -let g:nvim_config_root = expand('<sfile>:p:h') -set rtp+=~/.config/nvim -set rtp+=~/.config/nvim/bundle/Vundle.vim -call vundle#begin('~/.config/nvim/bundle') - -Plugin 'VundleVim/Vundle.vim' -Plugin 'scrooloose/nerdcommenter' -Plugin 'vim-airline/vim-airline' - -call vundle#end() +set rtp+=$XDG_CONFIG_HOME/vim/ +call plug#begin("$XDG_CONFIG_HOME/vim/plugins") +Plug 'scrooloose/nerdcommenter' +Plug 'vim-airline/vim-airline' +Plug 'tpope/vim-commentary' +call plug#end() filetype plugin indent on syntax on @@ -19,13 +15,15 @@ set shiftwidth=4 set expandtab set autochdir set colorcolumn=80,120 +highlight ColorColumn ctermbg=8 guibg=lightgrey set formatprg=par\ -w80 set autoread au CursorHold,CursorHoldI * checktime au FocusGained,BufEnter * :checktime " Enable clipboard buffer to be used as vim buffer -set clipboard=unnamedplus +" set clipboard=unnamedplus +set mouse=a " Settings for gvim set guioptions-=m "remove menu bar @@ -48,17 +46,20 @@ nnoremap <C-H> <C-W><C-H> nmap <leader>s <ESC>:vsplit<CR> nmap <leader>vs <ESC>:split<CR> -nmap <leader>f <ESC>za " NERDCommenter config let g:NERDSpaceDelims = 1 -let g:NERDCommentEmptyLines = 1 +let g:NERDDefaultAlign = 'left' +let g:NERDCommentEmptyLines = 0 let g:NERDTrimTrailingWhitespace = 1 let g:NERDTreeChDirMode=2 " NERDCommenter shortcuts -nmap <C-\> <leader>c<space> -vmap <C-\> <leader>c<space> +nmap <C-k> <leader>c<space> +vmap <C-k> <leader>c<space> -" Calling my script that allows per-project configuration of tasks keybindings -call projector#init() +" Copy to clipboard +nmap <leader>y "+y +vmap <leader>y "+y +nmap <leader>d "+d +vmap <leader>d "+d |