1
0
Fork 0
mirror of synced 2024-12-24 07:43:20 -05:00
The ultimate Vim configuration: vimrc
Find a file
2019-08-07 11:34:24 -07:00
autoload Updated plugins 2014-09-27 16:32:18 +01:00
my_plugins Allow to install custom plugins 2017-05-20 11:33:48 +02:00
sources_forked Fixed https://github.com/amix/vimrc/issues/325 2017-07-16 14:38:57 +02:00
sources_non_forked added easymotion 2019-08-06 17:20:48 -07:00
temp_dirs Re-updated the undo dir git ignore 2016-06-26 13:14:51 +02:00
vimrcs more easymotion configuration 2019-08-07 10:53:35 -07:00
.gitignore Allow to install custom plugins 2017-05-20 11:33:48 +02:00
install_awesome_parameterized.sh Parameterized install script (#337) 2018-03-12 11:52:13 -03:00
install_awesome_vimrc.sh Fixed https://github.com/amix/vimrc/issues/278 2017-04-01 13:38:55 +02:00
install_basic_vimrc.sh Fixed https://github.com/amix/vimrc/issues/278 2017-04-01 13:38:55 +02:00
LICENSE Create LICENSE 2016-02-20 13:19:07 +00:00
README.md updated correct installation 2019-08-07 11:34:24 -07:00
update_plugins.py Added auto-pairs, lightline-ale and comfortable-motion.vim 2018-06-14 12:30:22 +02:00

The Ultimate vimrc - Addons Edition

Additional mappings and a few modifications. EasyMotion is included in the plugins.

How to install the Addons Edition?

Install for your own user only

git clone --depth=1 https://github.com/aquaductape/vimrc.git ~/.vim_runtime
sh ~/.vim_runtime/install_awesome_vimrc.sh

Install for multiple users

To install for multiple users, the repository needs to be cloned to a location accessible for all the intended users.

git clone --depth=1 https://github.com/aquaductape/vimrc.git /opt/vim_runtime
sh /opt/vim_runtime/install_awesome_parameterized.sh /opt/vim_runtime user0 user1 user2
# to install for all users with home directories
sh /opt/vim_runtime/install_awesome_parameterized.sh /opt/vim_runtime --all

Naturally, /opt/vim_runtime can be any directory, as long as all the users specified have read access.

Additional Mappings

basic.vim

let mapleader = " "

" Treat long lines as break lines (useful when moving around in them)
map j gj
map k gk

" Remap VIM ESC to normal mode from insert mode using jj
" only issue when you need to literally type two jj's in insert mode therefore you must type slowly
imap jj <Esc>

" Just like traditional Select All, Ctrl+a
map <C-a> ggVG

" Remap VIM H to first non-blank character
map H ^
" Remap VIM L to last blank character
map L $

" Clears highlighting
map <C-n> :noh<return>

" Replace word by occurence, press '.' to move to the next occurence which auto replaces with new word. I use it to rename variables. So far I haven't found a mapping that does it by scope reliably like vscode.
nnoremap gr *``cgn


" This loop remaps all 'alt key + character' to '\e + character'
" On my vim(windows, but some other windows users didn't have a problem)
" it won't recognize the Meta key when Alt is pressed
" https://vi.stackexchange.com/questions/2350/how-to-map-alt-key/2363

" for i in range(97,122)
"     let c = nr2char(i)
"     execute "set <M-".c.">=\e".c.""
"     " On the 'j' iteration it would look like this
"     " --> execute \"set <M-j>=\ej"
" endfor

" These two mappings are a quality of life improvement of copy/pasting from the clipboard
" Effectively this paste map applies the indent within the pasted content from the indent level that you're at when you invoke the pasting
" http://tilvim.com/2014/03/18/a-better-paste.html
map <Leader>p :set paste<CR>o<esc>"*]p:set nopaste<cr>
vmap <Leader>y "+y

" map <leader>pp :setlocal paste!<cr>

plugins_config.vim

let g:EasyMotion_do_mapping = 0 " Disable default mappings

" Jump to anywhere you want with minimal keystrokes, with just one key binding.
" `s{char}{label}`
nmap s <Plug>(easymotion-overwin-f)
" or
" `s{char}{char}{label}`
" Need one more keystroke, but on average, it may be more comfortable.
nmap s <Plug>(easymotion-overwin-f2)

" Turn on case-insensitive feature
let g:EasyMotion_smartcase = 1

" JK motions: Line motions
map <Leader>j <Plug>(easymotion-j)
map <Leader>k <Plug>(easymotion-k)

" Open a NERDTree automatically when vim starts up if no files were specified
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif

" Open NERDTree automatically when vim starts up on opening a directory
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif

" Shortcut to open NERDTree
map <C-t> :NERDTreeToggle<CR>

" Close vim if the only window left open is a NERDTree
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif