-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvim.cgf
More file actions
165 lines (144 loc) · 3.99 KB
/
vim.cgf
File metadata and controls
165 lines (144 loc) · 3.99 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
"VIM IMPORTS"
source ~/.vim/.gh-credentials
"INITIAL CONFIG"
set rtp+=$HOME/.vim/bundle/Vundle.vim
set rtp+=$HOME/.vim/bundle/fzf
set number
set nocompatible
set tabstop=2
set shiftwidth=2
set expandtab
set showmatch
set t_Co=256
set laststatus=2
set hlsearch
set incsearch
set ignorecase
set smartcase
set wildignore+=*.swp
set mouse=a
set clipboard+=unnamed
set timeoutlen=1000
set ttimeoutlen=0
set backspace=indent,eol,start
set noshowmode
syntax enable
colorscheme monokai
"colorscheme xcodedark"
"colorscheme xcodedarkhc"
"colorscheme xcodelight"
"colorscheme xcodelighthc"
"colorscheme xcodewwdc"
filetype off
filetype plugin indent on
"VUNDLE PLUGINS"
call vundle#begin()
Plugin 'Vundle/Vundle.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'tomtom/tcomment_vim'
Plugin 'ntpeters/vim-better-whitespace'
Plugin 'mustache/vim-mustache-handlebars'
Plugin 'mhinz/vim-signify'
Plugin 'itchyny/lightline.vim'
Plugin 'junegunn/fzf'
Plugin 'junegunn/fzf.vim'
Plugin 'itchyny/vim-gitbranch'
Plugin 'Yggdroot/indentLine'
Plugin 'prettier/vim-prettier'
Plugin 'wavded/vim-stylus'
Plugin 'tpope/vim-fugitive'
Plugin 'mattn/webapi-vim'
Plugin 'mattn/vim-gist'
Plugin 'fatih/vim-go'
Plugin 'iamcco/markdown-preview.nvim'
Plugin 'ryanoasis/vim-devicons'
Plugin 'mhinz/vim-startify'
Plugin 'godlygeek/tabular'
Plugin 'preservim/vim-markdown'
Plugin 'sheerun/vim-polyglot'
Plugin 'yuezk/vim-js'
Plugin 'HerringtonDarkholme/yats.vim'
Plugin 'maxmellon/vim-jsx-pretty'
call vundle#end()
"NERDTREE CONFIG"
function! CloseHiddenBuffers()
let open_buffers = []
for i in range(tabpagenr('$'))
call extend(open_buffers, tabpagebuflist(i + 1))
endfor
for num in range(1, bufnr("$") + 1)
if buflisted(num) && index(open_buffers, num) == -1
exec "bdelete ".num
endif
endfor
endfunction
au BufEnter * call CloseHiddenBuffers()
let NERDTreeShowHidden = 1
let NERDTreeRespectWildIgnore = 1
"FILE ASSOCIATION CONFIG"
au BufReadPost *.cgf set syntax=sh
au BufEnter *.cgf set syntax=sh
au BufReadPost *.tmux set syntax=sh
au BufEnter *.tmux set syntax=sh
au BufReadPost *.ts set syntax=javascript
au BufEnter *.ts set syntax=javascript
au BufReadPost *.tsx set syntax=javascript
au BufEnter *.tsx set syntax=javascript
"VIM JSX PRETTY CONFIG"
let g:vim_jsx_pretty_colorful_config = 1
"PRETTIER CONFIG"
let g:prettier#config#semi = 'false'
let g:prettier#config#single_quote = 'true'
"SESSION CONFIG"
let g:session_autoload = 0
"LIGHTLINE CONFIG"
let g:lightline = {
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component_function': {
\ 'gitbranch': 'MyFugitiveHead',
\ 'filetype': 'MyFiletype',
\ 'fileformat': 'MyFileformat',
\ },
\ }
let g:indentLine_char = '│'
function MyFugitiveHead()
let head = FugitiveHead()
if head != ""
let head = "\uf126 " .. head
endif
return head
endfunction
function! MyFiletype()
return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype . ' ' . WebDevIconsGetFileTypeSymbol() : 'no ft') : ''
endfunction
function! MyFileformat()
return winwidth(0) > 70 ? (&fileformat . ' ' . WebDevIconsGetFileFormatSymbol()) : ''
endfunction
"VIM GIST CONFIG"
let g:github_user = gh_user
let g:gist_token = gh_token
"VIM MARKDOWN CONFIG"
let g:vim_markdown_folding_disabled = 1
"FZF CONFIG"
let $FZF_DEFAULT_COMMAND='find . \( -name node_modules -o -name tmp -o -name .git \) -prune -o -print'
"KEYBOARD MAPPING CONFIG"
nnoremap <C-Left> :tabprevious <CR>
nnoremap <C-Right> :tabnext <CR>
nnoremap <C-T> :tabnew <CR>
nnoremap <C-F> :FZF <CR>
nnoremap <C-N> :NERDTreeToggle <CR>
nnoremap <C-L> :NERDTreeFind <CR>
nnoremap <C-P> :Prettier <CR>
nnoremap <C-E> :e! <CR>
nnoremap <C-X> :x <CR>
nnoremap <C-O> :w <CR>
nnoremap <Bar> :vsplit <CR>
nnoremap _ :split <CR>
nnoremap <C-K> :Gist -l <CR>
vnoremap <C-U> :s#_\(\l\)#\u\1#g <CR>
vnoremap <C-D> :s#-\(\l\)#\u\1#g <CR>
vnoremap <S-U> :s/\(\l\)\(\u\)/\1_\l\2/g <CR>
vnoremap <S-D> :s/\(\l\)\(\u\)/\1-\l\2/g <CR>