-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.vim
More file actions
122 lines (98 loc) · 2.89 KB
/
init.vim
File metadata and controls
122 lines (98 loc) · 2.89 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
"https://blog.nikfp.com/how-to-install-and-set-up-neovim-on-windows
":h lua-guide
let s:vimPlugPath = stdpath('data').'/site/autoload/plug.vim'
let s:autoloadDir = stdpath('data').'/site/autoload'
if empty(glob(s:vimPlugPath))
if !isdirectory(s:autoloadDir)
call mkdir(s:autoloadDir, 'p')
endif
execute '!curl -fLo "'.s:vimPlugPath.'" https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
execute 'source '.s:vimPlugPath
let s:runPlugInstall = 1
endif
" May help performance on some systems (maybe Windows).
"set nofsync
" Set <Leader> and <LocalLeader> key binds for custom prefixing of keybinds
" from plugins.
let mapleader = ' '
let maplocalleader = '\'
" Set to true if you have a Nerd Font installed and selected in the terminal
" Some nerd fonts can be downloaded from https://www.nerdfonts.com/font-downloads
lua vim.g.have_nerd_font = true
set encoding=utf-8
" Setup line number column.
set number
set relativenumber
set autowriteall
set cursorline
set nofoldenable
set foldmethod=indent
" Set whitespace character visualization.
set list
set listchars+=space:·
set colorcolumn=80,100
set smartcase
set ignorecase
set tags=./tags,tags;$HOME
" Line wrapping
set wrap
set breakindent
" Settings for controlling indentation.
set tabstop=4
set softtabstop=4
set shiftwidth=4
set smarttab
set noexpandtab
set confirm
" Switching between previous and next split.
nmap <C-l> <C-w>w
nmap <C-h> <C-w>W
" Switching between previous and next buffer in current split.
nmap <C-PageUp> <Cmd>bp<Enter>
nmap <C-PageDown> <Cmd>bn<Enter>
" Invoking :make command quickly.
nmap m <Cmd>make<Enter>
" Close current buffer without closing window/split. Basically moves to
" previous buffer, creates new split, returns to original buffer and closes
" the split.
nmap <C-q> <Cmd>bp<Bar>sp<Bar>bn<Bar>bd<Enter>
" Clear highlights on search when pressing <Esc> in normal mode
" See `:help hlsearch`
nmap <Esc> <Cmd>nohlsearch<CR>
" Use `:PlugInstall` after adding a plugin to install it.
call plug#begin()
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.8' }
Plug 'nvim-lualine/lualine.nvim'
Plug 'ziglang/zig.vim'
Plug 'nvim-tree/nvim-web-devicons'
Plug 'nvim-treesitter/nvim-treesitter', { 'do': ':TSUpdate' }
Plug 'mason-org/mason.nvim'
Plug 'Civitasv/cmake-tools.nvim'
" plug#end() automatically executes
" :filetype plugin indent on
" :syntax enable
call plug#end()
if exists('s:runPlugInstall')
PlugInstall
endif
nnoremap <C-p> <Cmd>Telescope find_files<Enter>
lua << EOF
require('lualine').setup({
options = {
theme = 'ayu_dark',
},
})
require('nvim-treesitter.configs').setup({
highlight = { enable = true }
})
require('mason').setup()
EOF
nmap <Leader>m <Cmd>CMakeBuild<Enter>
nmap <Leader>ccp <Cmd>CMakeSelectConfigurePreset<Enter>
nmap <Leader>cbp <Cmd>CMakeSelectBuildPreset<Enter>
" Delete temporary variables.
for k in keys(s:)
"echo 's:'.k.'='s:[k]
unlet s:[k]
endfor