Skip to content

Instantly share code, notes, and snippets.

@jargnar
Created July 15, 2018 09:51
Show Gist options
  • Save jargnar/7099e0d3199b3b2f076914760f6f08a6 to your computer and use it in GitHub Desktop.
Save jargnar/7099e0d3199b3b2f076914760f6f08a6 to your computer and use it in GitHub Desktop.
vimrc
" Suhas vimrc
" MIT License
" Copyright 2018, <jargnar@gmail.com>
"----------------------------------------
" System: plugin manager
"----------------------------------------
call plug#begin('~/.vim/plugged')
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'majutsushi/tagbar'
Plug 'terryma/vim-multiple-cursors'
call plug#end()
"----------------------------------------
" System: general
"----------------------------------------
set nocompatible
set encoding=utf-8
set number
set ruler
set ignorecase
set smartcase
set autoindent
set laststatus=2
filetype off
filetype plugin indent on
syntax on
let mapleader = ","
"----------------------------------------
" Plug: 'majutsushi/tagbar'
"----------------------------------------
let g:Tlist_Ctags_Cmd='/usr/local/Cellar/ctags/5.8_1/bin/ctags'
nmap <F3> :TagbarToggle<CR>
"----------------------------------------
" Plug: 'junegunn/fzf.vim'
"----------------------------------------
nnoremap <c-p> :FZF<cr>
"----------------------------------------
" System: behaviour
"----------------------------------------
"
" #1. Keep visual selections alive after < or >
vnoremap < <gv
vnoremap > >gv
"
" #2. Show, color and fix whitespaces
highlight ws ctermbg=red guibg=red
match ws /\s\+$/
autocmd BufWinEnter * match ws / \+$/
command! -range=% Fws execute ':' . <line1> . ',' . <line2> . 's/\\\@<!\s\+$//'
"
" #3. Speed. Make movements nimbler
nnoremap j jjjjj
nnoremap k kkkkk
nnoremap h hhh
nnoremap l lll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment