-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
executable file
·106 lines (82 loc) · 2.22 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
set nocompatible " be iMproved, required
filetype off " required
call plug#begin('~/.vim/plugged')
" Basic plugins
Plug 'preservim/nerdtree'
Plug 'junegunn/fzf' " Install the_silver_searcher
Plug 'junegunn/fzf.vim'
Plug 'kien/ctrlp.vim'
Plug 'preservim/nerdcommenter'
Plug 'jiangmiao/auto-pairs'
Plug 'tpope/vim-fugitive'
Plug 'vim-airline/vim-airline'
Plug 'sjl/gundo.vim'
" Colorscheme & syntax
Plug 'catppuccin/vim', { 'as': 'catppuccin' }
call plug#end() " required
filetype plugin indent on " required
syntax on
let g:airline_powerline_fonts = 1
colorscheme catppuccin_latte
let g:lightline = {'colorscheme': 'catppuccin_latte'}
let g:airline_theme = 'catppuccin_latte'
set termguicolors
set noshowmode
" Leader
let mapleader=" "
" Tab behaviour
set tabstop=4
set softtabstop=4
set expandtab
" Show relative line number while editing
set number relativenumber
" Highlight current line
set cursorline
" highlight matching [{()}]
set showmatch
" visual autocomplete for command menu
set wildmenu
" Search behaviour
set incsearch
set hlsearch
nnoremap <leader><space> :nohlsearch<CR>
" Folding
set foldenable
set foldlevelstart=10
set foldnestmax=10
nnoremap <space> za
set foldmethod=indent
" move vertically by visual line
nnoremap j gj
nnoremap k gk
" toggle gundo
nnoremap <leader>u :GundoToggle<CR>
" allows cursor change in tmux mode
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
else
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif
" Global clipboard
set clipboard=unnamed
"" Bindings to switch between tabs
map <C-j> :tabprevious<CR>
nmap <C-j> :tabprevious<CR>
imap <C-j> <Esc>:tabprevious<CR>i
map <C-k> :tabnext<CR>
nmap <C-k> :tabnext<CR>
imap <C-k> <Esc>:tabnext<CR>i
" Setting line number
:augroup numbertoggle
: autocmd!
: autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
: autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
:augroup END
" Some servers have issues with backups
set nobackup
set nowritebackup
" Better user experience
set updatetime=300
set conceallevel=2