-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
107 lines (80 loc) · 2.63 KB
/
vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
" General Vim Settings
" --------------------
set nocompatible
filetype plugin indent on
syntax on
set backspace=2 " Backspace deletes like most programs in insert mode
set nobackup
set nowritebackup
set noswapfile
set history=50
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set incsearch " do incremental searching
set laststatus=2 " Always display the status line
set autowrite " Automatically :write before running commands
set formatoptions-=t " Don't auto-break long lines (re-enable this for prose)
set ignorecase
" Softtabs, 2 spaces
set tabstop=2
set shiftwidth=2
set shiftround
set expandtab
" Display extra whitespace
silent! set list listchars=tab:»·,trail:·,nbsp:·
" Use one space, not two, after punctuation.
set nojoinspaces
" Display relative line numbers, with absolute line number for current line
set number
set numberwidth=5
" set relativenumber
" When the type of shell script is /bin/sh, assume a POSIX-compatible
" shell for syntax highlighting purposes.
let g:is_posix = 1
" Set spellfile to location that is guaranteed to exist, can be symlinked to
" Dropbox or kept in Git and managed outside of thoughtbot/dotfiles using rcm.
set spellfile=$HOME/.vim-spell-en.utf-8.add
" Autocomplete with dictionary words when spell check is on
set complete+=kspell
set splitright
let mapleader=" "
" Base64 decode word under cursor
nmap <Leader>b :!echo <C-R><C-W> \| base64 -d<CR>
" grep recursively for word under cursor
nmap <Leader>g :tabnew\|read !grep -Hnr '<C-R><C-W>'<CR>
" sort the buffer removing duplicates
nmap <Leader>s :%!sort -u --version-sort<CR>
" Don't require saving before closing a buffer
set hidden
set path+=**
set wildmenu
set wildmode=list:longest
set shell=/bin/bash
call plug#begin('~/.vim/plugins')
" Fugitive - Vim meets git. Gstatus, Gdiff, etc.
" Plug 'tpope/vim-fugitive'
" nnoremap \<space> :Git<cr>:wincmd _<cr>
" nnoremap \gr :Grebase -i master<cr>
Plug 'morhetz/gruvbox'
Plug 'scrooloose/nerdtree'
" Surround - Mappings for adding, removing, and changing surrounding characters
Plug 'tpope/vim-surround'
" TextObj - Custom text objects for the line, indent level, entier file, etc
Plug 'kana/vim-textobj-user'
Plug 'kana/vim-textobj-line'
Plug 'kana/vim-textobj-indent'
Plug 'kana/vim-textobj-entire'
Plug 'beloglazov/vim-textobj-quotes'
Plug 'christoomey/vim-textobj-codeblock'
call plug#end()
" Post plugin setup
" *****************
" gruvbox
silent! color gruvbox
set background=dark
" vim surround
let g:surround_99 = "```\r```"
" *****************
" setup nerd tree for Ctrl-N
nmap <C-n> :NERDTreeToggle<CR>
" vim:ft=vim