-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc
More file actions
152 lines (121 loc) · 5.47 KB
/
.vimrc
File metadata and controls
152 lines (121 loc) · 5.47 KB
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
" === Vundle-required config ===================================== "
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
" Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
" Plugin 'L9'
" Git plugin not hosted on GitHub
" Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
" Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
" Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.
" Plugin 'ascenator/L9', {'name': 'newL9'}
Bundle 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}
Plugin 'scrooloose/nerdtree'
Plugin 'typescript-vim'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
" === End Vundle =============================================== "
set nocompatible " full vim
syntax enable " enable syntax highlighting
set encoding=utf8 " utf8 default encoding
:let mapleader = ","
set scrolloff=3 " show 3 lines of context around the cursor
set autoread " set to auto read when a file is changed from the outside
set autowrite
set showcmd " show typed commands
set wildmenu " turn on WiLd menu
set wildmode=list:longest,list:full " activate TAB auto-completion for file paths
set wildignore+=*.o,.git,.svn
set ruler " always show current position
set backspace=indent,eol,start " set backspace config, backspace as normal
set hlsearch " highlight search things
set incsearch " go to search results as typing
set smartcase " but case-sensitive if expression contains a capital letter.
set ignorecase " ignore case when searching
set gdefault " assume global when searching or substituting
set magic " set magic on, for regular expressions
set showmatch " show matching brackets when text indicator is over them
set lazyredraw " don't redraw screen during macros, faster
set ttyfast " improves redrawing for newer computers
set fileformats=unix,mac,dos
set nobackup " prevent backups of files, since using vcs
set nowritebackup
set noswapfile
set shiftwidth=2 " set tab width
set softtabstop=2
set tabstop=2
set smarttab
set expandtab " use spaces, not tabs
set autoindent " set automatic code indentation
set hidden " allow background buffers w/out writing
set nowrap " don't wrap lines
set list " show hidden characters
set listchars=tab:\ \ ,trail:· " show · for trailing space, \ \ for trailing tab
set laststatus=2 " always hide the last status
" map Y to match C and D behavior
nnoremap Y y$
" ignore lines when going up or down
nnoremap j gj
nnoremap k gk
" auto complete {} indent and position the cursor in the middle line
inoremap {<CR> {<CR>}<Esc>O
inoremap (<CR> (<CR>)<Esc>O
inoremap [<CR> [<CR>]<Esc>O
" fast window switching
map <leader>, <C-W>w
" cycle between buffers
map <leader>. :b#<cr>
" indent visual selected code without unselecting and going back to normal mode
vmap > >gv
vmap < <gv
" clear highlight
nnoremap <leader><space> :noh<cr>
" fast escape
:imap jj <Esc>
" If no file specified, start with nerdtree
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
" Fast toggle for nerdtree
map <leader>n :NERDTreeToggle<CR>
" FOLDING
set foldenable " enable folding
set foldmethod=indent " most files are evenly indented
set foldlevel=99
set t_Co=256 " use 256 colors
set background=dark
if exists('+colorcolumn')
set colorcolumn=115 " show a right margin column
endif
set cursorline " highlight current line
" define custom cursor line if theme doesn't
hi CursorLine cterm=NONE ctermbg=234
set number
set relativenumber
:highlight LineNr term=bold cterm=NONE ctermfg=DarkGrey ctermbg=NONE gui=NONE guifg=DarkGrey guibg=NONE
:highlight CursorLineNr term=bold cterm=NONE ctermfg=DarkGrey ctermbg=NONE gui=NONE guifg=DarkGrey guibg=NONE