-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
executable file
·166 lines (133 loc) · 4.76 KB
/
Copy pathvimrc
File metadata and controls
executable file
·166 lines (133 loc) · 4.76 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
" SAVE THIS FILE AS YOUR .vimrc FILE IN YOUR HOME DIRECTORY
" Enjoy!
set nocompatible
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 'gmarik/Vundle.vim'
" Other plugins
Plugin 'scrooloose/nerdtree'
Plugin 'gregsexton/gitv'
Plugin 'tpope/vim-endwise'
Plugin 'tpope/vim-markdown'
Plugin 'tpope/vim-rails'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-fugitive'
Plugin 'tomtom/tcomment_vim'
Plugin 'scrooloose/syntastic'
Plugin 'guns/vim-clojure-static'
Plugin 'tpope/vim-fireplace'
Plugin 'ervandew/supertab'
Plugin 'tpope/vim-obsession'
Plugin 'posva/vim-vue'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'rust-lang/rust.vim'
Plugin 'fatih/vim-go'
Plugin 'zivyangll/git-blame.vim'
Plugin 'leafgarland/typescript-vim'
Plugin 'maxmellon/vim-jsx-pretty'
Plugin 'pangloss/vim-javascript'
" TODO: typescript code completion https://pragmaticpineapple.com/ultimate-vim-typescript-setup/#code-completions
call vundle#end() "Required, plugins must be add before this line
syntax on
filetype plugin indent on "Required
set number " Show line numbers
set ruler " Show line and column location of cursor
if has("gui_running")
set guioptions=egmrt "Disable menu bar for gvim/macvim
set guifont=Menlo\ Regular:h12
"set transparency=10
"hi Visual guibg=#223366
endif
" Behavior
set nobackup "don't create backup files
set ignorecase "ignore case in searched
set nocompatible "disable VI compatibility mode
set ai "autoindent
set si "smart indent
set ofu=syntaxcomplete#Complete "Enable syntax completion
set encoding=utf-8
set spelllang=en_us " Set spell check language
set nowrap " Disable word wrap.
set history=200
set hidden
set autoread " reload files when changed on disk, i.e. via `git checkout`
set clipboard=unnamed " yank and paste with the system clipboard
set scrolloff=10 " show context above/below cursorline
" colorscheme grb256 " Sets default colorscheme to grb256, a dark background with blue text
" colorscheme molokai " Sets default colorscheme to monokai, a gray brown background with green text
" let g:molokai_original = 1 " Doesn't work with vim-clojure-static plugin
set tabstop=2
set softtabstop=2
" NORMAL MODE
" Activate after saving.
iunmenu File.Save
imenu <silent> File.Save <Esc>:w<CR>
" Inserting empty lines using [enter] when in normal mode.
map <S-Enter> O<Esc>
map <CR> o<Esc>k
" Insert spaces using space bar when in normal mode.
nnoremap <space> i<space><esc>
" Remove search highlighting with <leader><space>
nnoremap <silent> <leader><space> :noh<CR>
" Searching
set hlsearch "Highlight found searches
set incsearch
set smartcase
map <silent> // :noh<CR>
" Moving lines up/down using [apple]-[shift]-[up]/[down].
" nmap <silent> <D-S-down> ddp==
" nmap <silent> <D-S-up> yykPjjddkk==
"nmap <silent> <D-S-up> ddkP==
" Duplicating lines.
nnoremap <silent> <D-d> yyp
imap <silent> <D-d> <esc>yypi
imap <silent> <D-S-down> <esc>ddp==i
imap <silent> <D-S-up> <esc>ddkP==i
" Saving
" Stripping Whitespace on save.
" autocmd BufWritePre * :%s/\s\+$//e
let mapleader = ","
" NERDTree
map <C-n> :NERDTreeToggle<CR>
" workaround for ^G error https://github.com/scrooloose/nerdtree/issues/928
let g:NERDTreeNodeDelimiter = "\u00a0"
" Make ESC key into noop
nnoremap <esc> :noh<return><esc>
nnoremap <leader>h <C-w>h
nnoremap <leader>j <C-w>j
nnoremap <leader>k <C-w>k
nnoremap <leader>l <C-w>l
" Something about apple computers inserting weird characters when you use
" arrow keys
nnoremap <silent> <ESC>OA <Nop>
nnoremap <silent> <ESC>OB <Nop>
nnoremap <silent> <ESC>OC <Nop>
nnoremap <silent> <ESC>OD <Nop>
inoremap <silent> <ESC>OA <Nop>
inoremap <silent> <ESC>OB <Nop>
inoremap <silent> <ESC>OC <Nop>
inoremap <silent> <ESC>OD <Nop>
" Manually disable arrow keys to force you to learn vim
" inoremap <Up> <NOP>
" inoremap <Down> <NOP>
" inoremap <Left> <NOP>
" inoremap <Right> <NOP>
" noremap <Up> <NOP>
" noremap <Down> <NOP>
" noremap <Left> <NOP>
" noremap <Right> <NOP>
""""""" Startup commands
"" Open NerdTree for every file
" autocmd vimenter * NERDTree
"" Open NerdTree if no file specified
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
"" close vim if only NERDtree open
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
""" RUST
let g:rustfmt_autosave = 1