-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvim_tiny_rc
116 lines (103 loc) · 3.74 KB
/
vim_tiny_rc
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
syntax on
if !has('nvim')
set nocompatible " be iMproved
endif
set mouse=a
set ts=4
set expandtab
set autoindent
set cindent
set magic
let mapleader = ' '
set noswapfile
set nobackup
if !has('nvim')
set encoding=utf-8
endif
set autoread
set autowrite
set fileformats=unix,dos,mac
set backspace=indent,eol,start
set nohlsearch
" set incsearch
set laststatus=2
set noerrorbells
set showcmd
set showmode
" set completeopt-=preview
set nu
set numberwidth=2
set nolist
set cursorline
call plug#begin('~/.vim/plugged')
Plug 'sheerun/vim-polyglot'
Plug 'tomtom/tcomment_vim'
Plug 'tpope/vim-surround'
Plug 'tmhedberg/matchit'
Plug 'jiangmiao/auto-pairs'
Plug 'scrooloose/nerdtree'
Plug 'Yggdroot/indentLine'
Plug 'Lokaltog/vim-easymotion'
Plug 'ghifarit53/tokyonight-vim'
Plug 'tribela/vim-transparent'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'catppuccin/vim', { 'as': 'catppuccin' }
call plug#end()
autocmd FileType * set shiftwidth=4 | set expandtab | set tabstop=4
autocmd FileType html,less,sass,scss,css set shiftwidth=2 | set expandtab | set tabstop=2
autocmd FileType make setlocal noexpandtab
autocmd FileType java set omnifunc=javacomplete#Complete
autocmd FileType less set omnifunc=csscomplete#CompleteCSS
autocmd FileType c,cpp,objc,objcpp setl omnifunc=clang_complete#ClangComplete
autocmd FileType javascript set formatprg=prettier\ --stdin\ --single-quote\ --trailing-comma\ none\ --tab-width\ 4\ --print-width\ 100
let g:neoformat_try_formatprg = 1
" au FileType typescript setl omnifunc=tsuquyomi#complete
" au FileType typescript setl completeopt-=menu
" for scss
au BufRead,BufNewFile *.scss set filetype=scss
" for objective c
au BufRead,BufNewFile *.m set filetype=objc
" for tern project file
au BufRead,BufNewFile *.tern-project,*.tern-config set filetype=json
" for nasm
au BufRead,BufNewFile *.asm set filetype=nasm
" for nginx
au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/conf/*,/usr/local/etc/nginx/* if &ft == '' | setfiletype nginx | endif
nmap <leader>k :NERDTreeToggle<cr>
nmap <leader>/ :TComment<cr>
vmap <leader>/ :TComment<cr>gv
set termguicolors
let g:tokyonight_style = 'storm' " available: night, storm
let g:tokyonight_enable_italic = 1
colorscheme catppuccin_mocha
nmap <silent> <leader>g :<C-U>call magit#show_magit('h')<CR>
nmap <silent> <leader>p :<C-U>CocList files<CR>
nmap <silent> <leader>o :<C-U>CocList mru<CR>
nmap <silent> <leader>b :<C-U>CocList buffers<CR>
nmap <silent> <leader>f :<C-U>CocList --auto-preview --interactive grep<CR>
nmap <silent> <leader>ld <Plug>(coc-definition)
nmap <silent> <leader>lr <Plug>(coc-references)
nmap <silent> <leader>ln <Plug>(coc-rename)
nmap <silent> <leader>lf <Plug>(coc-format)
vmap <silent> <leader>lf <Plug>(coc-format-selected)
nmap <silent> <leader>li <Plug>(coc-implementation)
nmap <silent> <leader>lt <Plug>(coc-type-definition)
nmap <silent> <leader>la <Plug>(coc-codeaction)
vmap <silent> <leader>la <Plug>(coc-codeaction-selected)
nmap <silent> <leader>lh :<C-U>call CocAction('doHover')<CR>
nmap <silent> <leader>lc :<C-U>CocList commands<CR>
nmap <silent> <leader>lo :<C-U>CocList outline<CR>
nmap <silent> <leader>le :<C-U>CocList diagnostics<CR>
nmap <silent> <leader>gb :<C-U>CocList branches<CR>
nmap <silent> <leader>gc :<C-U>CocList commits<CR>
let g:indentLine_char = "┆"
let g:indentLine_first_char = "┆"
inoremap <silent><expr> <TAB>
\ coc#pum#visible() ? coc#pum#next(1) :
\ CheckBackspace() ? "\<Tab>" :
\ coc#refresh()
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
" Make <CR> to accept selected completion item or notify coc.nvim to format
" " <C-g>u breaks current undo, please make your own choice.
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>""