-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
163 lines (125 loc) · 3.73 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
set nocompatible
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/plugged')
" Plug 'Shougo/deoplete.nvim'
" Plug 'leshill/vim-json'
" Plug 'bronson/vim-trailing-whitespace'
" Plug 'scrooloose/nerdtree.git'
" Plug 'tpope/vim-surround'
" Plug 'git://git.wincent.com/command-t.git'
" Plug 'godlygeek/tabular'
" Plug 'mhinz/vim-signify'
" Plug 'jdkanani/vim-material-theme'
" Plug 'trevordmiller/nova-vim'
" Plug 'joshdick/onedark.vim'
" Plug 'tpope/vim-fugitive'
" Plug 'janko-m/vim-test'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'scrooloose/nerdcommenter'
Plug 'scrooloose/syntastic'
Plug 'Raimondi/delimitMate'
Plug 'bling/vim-airline'
Plug 'edkolev/tmuxline.vim'
Plug 'airblade/vim-gitgutter'
Plug 'sheerun/vim-polyglot'
Plug 'junegunn/fzf'
Plug 'kien/ctrlp.vim'
Plug 'prettier/vim-prettier'
Plug 'drewtempelmeyer/palenight.vim'
Plug 'brooth/far.vim'
call plug#end()
" Set syntax highlighting on
syntax on
" Set column width for git commit msg
au FileType gitcommit set tw=72
" I want my files to be utf-8 "
set encoding=utf-8
" Reload files modified outside of Vim "
set autoread
" Replace tabs with spaces "
set expandtab
set shiftwidth=2
set softtabstop=2
" Faster terminal
set ttyfast
" If I am in an indented block of code, keep the indentation level when I "
" press enter "
set autoindent
" Show line numbers "
set number
set rnu
" Highlight all occurrences of a search "
set hlsearch
" Highlight column 81 to help keep lines of code 80 characters or less "
set colorcolumn=81
set backspace=indent,eol,start " backspace over everything in insert mode
" Allows normal mode to autocomplete paths using tab like bash does "
set wildmenu
set wildmode=list:longest
" When choosing a file from a quickfix buffer, open in a new tab or in "
" an already opened tab "
set switchbuf+=usetab,newtab
" Shift+Tab unindents a line "
imap <S-Tab> <Esc><<i
nmap <S-tab> <<
" Allow the use of 256 colors in the terminal "
" set t_Co=256
" Show matching brackets/parenthesis
set showmatch
" Remove trailing spaces when saving a file "
autocmd BufWritePre * :%s/\s\+$//e
" Make editing crontabs possible (disable backup and make in-place editing)
autocmd FileType crontab setlocal nowritebackup
" let g:solarized_termcolors=256
" let base16colorspace=256
set background=dark
" colorscheme base16-solarized
colorscheme palenight
" Turn on auto-complete
filetype plugin on
set omnifunc=syntaxcomplete#Complete
" Enable vim airline on single files
set laststatus=2
filetype indent plugin on
" NERD tree tabs
map <C-l> :tabn<CR>
map <C-h> :tabp<CR>
"map <C-n> :tabnew<CR>
nnoremap <esc><esc> :noh<CR>
" leader key
let mapleader = ','
" Put backup and swap files away from working directory
set backupdir=~/.vim/backup//
set directory=~/.vim/swap//
set undodir=~/.vim/undo//
" ctrlp: ignore bower and node files
let g:ctrlp_custom_ignore = '\v[\/](bower_components|node_modules)$'
" Wrapped lines goes down/up to next row, rather than next line in file.
noremap j gj
noremap k gk
" Move blocks
nnoremap <A-j> :m .+1<CR>==
nnoremap <A-k> :m .-2<CR>==
inoremap <A-j> <Esc>:m .+1<CR>==gi
inoremap <A-k> <Esc>:m .-2<CR>==gi
vnoremap <A-j> :m '>+1<CR>gv=gv
vnoremap <A-k> :m '<-2<CR>gv=gv
" Buffer keybinds for fzf
nmap ; :Buffers<CR>
nmap <Leader>t :Files<CR>
nmap <Leader>r :Tags<CR>
" let macvim_skip_colorscheme=1
" https://github.com/tmux/tmux/issues/1246
" Enable true color
if exists('+termguicolors')
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
endif
" Fix performance issue on far.vim
set lazyredraw
set regexpengine=1