-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
117 lines (87 loc) · 2.48 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
""""""""""""""""""""""""""""""""""""""""""""""""""
" "
" Non-plugin stuff : "
" "
""""""""""""""""""""""""""""""""""""""""""""""""""
"-> General
""""""""""""""""""""""""""""""""""""""""""""""""""
" Sets how many lines VIM has to remember
set history=500
" Set vim update time (milliseconds)
set updatetime=250
" Detect plugins filetypes
filetype plugin on
" Defining the <leader>
let mapleader = " "
" Remove the pause when leaving insert mode
set ttimeoutlen=10
" Autocomplete settings
set wildmode=longest,list,full
""""""""""""""""""""""""""""""""""""""""""""""""""
" -> VIM User Interface
""""""""""""""""""""""""""""""""""""""""""""""""""
" Sets the font
set guifont=FiraCode\ Nerd\ Font\ Mono\ 12
" Set utf8 as standard encoding
set encoding=utf-8
" Shows the current position
set ruler
" Shows line numbers
set number
" Shows line numbers relative to the cursor
set relativenumber
" A buffer becomes hidden when abandonned
set hid
" Highlights search results
set hlsearch
" Searches before hitting ENTER
set incsearch
" Shows matching brackets when cursor is over them
set showmatch
" Shows the command that's being typed
set showcmd
" Splits to the right
set splitright
" Prevents nvim from being customized by text files commands
set nomodeline
"""""""""""""""""""""""""""""""""""""""""""""""""""
" -> Status line
"""""""""""""""""""""""""""""""""""""""""""""""""""
"Always show the status line
set laststatus=2
"Don't show editor mode
set noshowmode
" GUI colors
" set Vim-specific sequences for RGB colors
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
syntax enable
" Colorscheme
set background=dark
""""""""""""""""""""""""""""""""""""""""""""""""""
" -> Text, tab and indent
""""""""""""""""""""""""""""""""""""""""""""""""""
" But be smart with tabs
set smarttab
" 1 tab = 4 spaces
set tabstop=4
set shiftwidth=2 "for indent operations
" Indent and wrap rules
set si "smart indent
set wrap "wrap lines
" Stops the auto-commenting new line
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
" Enable autocompletion
set wildmode=longest,list,full
" Automatically removes all trailing whitespaces on save
autocmd BufWritePre * %s/\s\+$//e
""""""""""""""""""""""""""""""""""""""""""""""""""
" -> Macros
""""""""""""""""""""""""""""""""""""""""""""""""""
" Clear the search highlight
noremap <leader>h :nohl<CR>
" Make use of xclipboard
nnoremap <leader>v "+p
vnoremap <leader>c "+y
set clipboard+=unnamedplus