-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
124 lines (107 loc) · 3.41 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
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
" options specifying ONLY {branch: main} are to circumvent the old 'master' default branch name
call plug#begin()
Plug 'tpope/vim-fugitive' "git stuff
Plug 'junegunn/fzf', { 'do': { -> fzf#install() }} "install latest binary for fzf
Plug 'junegunn/fzf.vim' "fuzzy finder for vim
Plug 'neovim/nvim-lspconfig'
"Plug 'nvim-lua/completion-nvim' "deprecated/archived
"consider nvim-cmp vs coq
"consider saga
Plug 'nvim-lua/plenary.nvim'
Plug 'akinsho/flutter-tools.nvim', {'branch': 'main'}
Plug 'hrsh7th/cmp-nvim-lsp', {'branch': 'main'}
Plug 'hrsh7th/cmp-buffer', {'branch': 'main'}
Plug 'hrsh7th/cmp-path', {'branch': 'main'}
Plug 'hrsh7th/cmp-cmdline', {'branch': 'main'}
Plug 'hrsh7th/nvim-cmp', {'branch': 'main'}
Plug 'hrsh7th/cmp-vsnip', {'branch': 'main'}
Plug 'hrsh7th/vim-vsnip'
Plug 'dart-lang/dart-vim-plugin' "dart syntax highligh
Plug 'leafgarland/typescript-vim' "ts syntax highlight
Plug 'peitalin/vim-jsx-typescript' "j/tsx syntax highlight
"Plug 'lervag/vimtex'
Plug 'dylanaraps/wal.vim'
"Plug 'mattn/emmet-vim'
call plug#end()
set relativenumber "hybrid line number mode
set number " current line number instead of 0
set tabstop=2 "tab chars -> 2 spaces
set softtabstop=2 "press tab -> insert 2 spaces
set shiftwidth=2
set expandtab "this turns tabs into spaces
set autoindent
set smartindent
"edit files directly instead of in swap file
set backupcopy=yes
" when opening new vertical/horizontal splits, do so to the right/bottom of
" active buffer
set splitbelow
set splitright
set showmatch "highlight matching braces
syntax on
colorscheme wal "use wal theme as colorscheme
" better contrast with coc-highlight
hi NvimInternalError ctermfg=0 ctermbg=9
hi Comment cterm=italic
set textwidth=79
set foldmethod=manual "manual folding
set foldnestmax=2 "limit one fold per fold
set incsearch "show results while searching
set ignorecase "case insensitive search by default
set smartcase "switch to sensitive search if capital letters present
"status line config (heavily inspired by George Onbo's config)
function! GitBranch()
return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'")
endfunction
function! StatusLineGit()
let l:branchname = GitBranch()
return strlen(l:branchname) > 0?''.l:branchname.' ':''
endfunction
set laststatus=2 "always show
set statusline=
"truncate from this point
set statusline+=%<
"show branch name if exists (max 20 chars)
set statusline+=%#SpecialKey#
set statusline+=%{StatusLineGit()}
"show filename (tail)
"set statusline+=%#SpecialKey#
"set statusline+=%t\
"file name (from current dir)
set statusline+=%#RedrawDebugComposed#
set statusline+=\ %f\
"right side
set statusline+=%=
"file type
set statusline+=%#RedrawDebugComposed#
set statusline+=%y\
"cur line / total lines
set statusline+=%#SpecialKey#
set statusline+=\ %l,%c\ \|\ %L
"netrw stuff
"start with banner collapsed
let g:netrw_banner = 0
"buffer split navigation
nnoremap <C-LEFT> <C-W><C-H>
nnoremap <C-DOWN> <C-W><C-J>
nnoremap <C-UP> <C-W><C-K>
nnoremap <C-RIGHT> <C-W><C-L>
"fuzzy find with control-p
nnoremap <C-P> :FZF<CR>
"ripgrep search from current dir
nnoremap <F8> :Rg<CR>
"toggle netrw directory tree
nnoremap <F4> :Lexplore<CR>
"git fugitive window:
nnoremap <F12> :Git<CR>
"apply suggestions
"nnoremap <F5> ???
"reload this file
nnoremap <F9> :so $MYVIMRC<CR>
"save
nnoremap <F6> :w<CR>
"crosshairs
nnoremap <F2> :set cuc! cul!<CR>
inoremap <F7> <C-X><C-O>
"open terminal in new window
nnoremap ;t :sp<CR>:term<CR>