-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvimrc
97 lines (79 loc) · 2.23 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
"--------------
"" Install plugins
"--------------
call plug#begin('~/.vim/plugged')
Plug '/usr/local/opt/fzf'
Plug 'junegunn/fzf.vim'
Plug 'altercation/vim-colors-solarized'
Plug 'tpope/vim-surround'
Plug 'vim-airline/vim-airline'
Plug 'editorconfig/editorconfig-vim'
Plug 'w0rp/ale'
Plug 'airblade/vim-gitgutter'
Plug 'scrooloose/nerdtree'
Plug 'scrooloose/nerdcommenter'
Plug 'FooSoft/vim-argwrap'
Plug 'pangloss/vim-javascript'
Plug 'vim-python/python-syntax'
Plug 'mattn/emmet-vim'
call plug#end()
"--------------
"" basic settings
"--------------
set nobackup " enable backups
set noswapfile " it's 2013, Vim.
set nocompatible
set mouse=a
filetype plugin on
filetype plugin indent on
syntax enable
filetype indent plugin on
colorscheme solarized
set background=dark
set expandtab
"--------------
"" Clipboard settings
"--------------
set clipboard=unnamed
"--------------
"" Keyboard shortcuts
"--------------
map <C-n> :NERDTreeToggle<CR>
nmap <leader>G :Goyo<CR>
noremap <Up> <NOP>
noremap <Down> <NOP>
noremap <Left> <NOP>
noremap <Right> <NOP>
" Open tab, move around tabs
map <C-l> :tabn<CR>
map <C-h> :tabp<CR>
map ,n :tabnew<CR>
"Close tab
map ,w :tabclose<CR>
" Use jj instead of Esc (because of new MacBook Pro)
imap jj <Esc>
"--------------
"" Buffer shortcuts
"--------------
" To open a new empty buffer
" This replaces :tabnew which I used to bind to this mapping
" Enable the list of buffers
" ALE
let g:ale_fixers = {'python': ['remove_trailing_lines', 'trim_whitespace', 'autopep8', 'prettier'], 'json': ['prettier'], 'javacript':['prettier'], 'html':['prettier']}
" Airline
let g:airline#extensions#tabline#enabled = 1
" My preference with using buffers. See `:h hidden` for more details
set hidden
nmap <leader>T :enew<cr>
"
" Move to the next buffer
nmap <leader>l :bnext<CR>
" Move to the previous buffer
nmap <leader>h :bprevious<CR>
" Close the current buffer and move to the previous one
" This replicates the idea of closing a tab
nmap <leader>bq :bp <BAR> bd #<CR>
" Show all open buffers and their status
nmap <leader>bl :ls<CR>
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endi
autocmd FileType python setlocal completeopt-=preview