-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.vim
More file actions
180 lines (154 loc) · 6.63 KB
/
init.vim
File metadata and controls
180 lines (154 loc) · 6.63 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
call plug#begin()
" Editor related
Plug 'airblade/vim-gitgutter'
" Plug 'edkolev/tmuxline.vim' " Makes the Tmux statusbar match vim-airline
" Plug 'edkolev/promptline.vim' " Makes the shell prompt match vim-airline
Plug 'vim-airline/vim-airline' " Vim statusbar
" allow :BD to close buffers without closing windows/splits
Plug 'qpkorr/vim-bufkill', { 'branch': 'master' }
Plug 'github/copilot.vim' " disabled in favor of zbirenbaum/copilot.lua
Plug 'mbbill/undotree' " Undo tree
Plug 'neovim/nvim-lspconfig' " https://github.com/neovim/nvim-lspconfig
Plug 'nvim-tree/nvim-tree.lua'
Plug 'nvim-tree/nvim-web-devicons'
Plug 'nvim-lua/plenary.nvim' " Required for telescope and elixir-tools
Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.8' }
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} " Finally had to get TS
" Themes
Plug 'Biscuit-Colorscheme/nvim' " Biscuit theme
Plug 'xero/miasma.nvim' " Miasma theme
Plug 'savq/melange-nvim' " Melange theme
Plug 'EdenEast/nightfox.nvim' " Nightfox (and terafox) theme
Plug 'vim-airline/vim-airline-themes'
Plug 'sainnhe/everforest' " Everforest theme
Plug 'sainnhe/sonokai' " Sonokai theme
Plug 'sainnhe/gruvbox-material' " Gruvbox Material theme
" LSP config and completion
Plug 'neovim/nvim-lspconfig'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/cmp-cmdline'
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-vsnip'
Plug 'hrsh7th/vim-vsnip'
" Language/tool specific
Plug 'rescript-lang/vim-rescript'
Plug 'jparise/vim-graphql' " GraphQL file detection, syntax hl, and indenting
Plug 'othree/html5.vim'
Plug 'leafOfTree/vim-svelte-plugin'
Plug 'sevko/vim-nand2tetris-syntax' " NAND2Tetris
Plug 'Bakudankun/PICO-8.vim', { 'branch': 'main' } " PICO-8 syntax highlighting
Plug 'ssteinbach/vim-pico8-syntax'
Plug 'markbahnman/vim-pico8-color', { 'branch': 'master' } " PICO-8 colorscheme
call plug#end()
runtime airlinecycle.vim " Cycle through airline themes
" Display options
autocmd BufNewFile,BufReadPost *.md set filetype=markdown "Forces .md = markdown
set nu " Turn on line numbering along left side
set scrolloff=2 " Show two lines above or below cursor when at edge of screen
set linebreak " Line wrapping that doesn't split words
set title " Show name of working file.
set showmatch " Highlight matching bracket, parenthesis, etc.
set matchpairs+=<:> " showmatch doesn't include < and > by default apparently
set wildmenu " Enables tab-complete for vim commands
syntax on " turns on colour syntax highlighting
set hlsearch " highlights searchterms in text
set incsearch " highlights search while searching
set laststatus=2 " Forces display of status bar
set lazyredraw " Disables screen redraws during macros
set updatetime=250 " redraws screen 4/sec instead of every 4 seconds
set ttimeoutlen=40 " stops delay exiting to normal mode
let g:rainbow_active = 1 " Turns on rainbow parens
set colorcolumn=60,80 " Highlights columns 60 and 80
let g:neovide_fullscreen = 1 " Fullscreen when using neovide
" Coloring / theming
command Drk set background=dark
command Lgt set background=light
command D colorscheme desert | AirlineTheme zenburn
command G colorscheme gruvbox-material | AirlineTheme zenburn
command Nf colorscheme nightfox | AirlineTheme zenburn
command Tf colorscheme terafox | AirlineTheme zenburn
command Df colorscheme dawnfox | AirlineTheme zenburn
command B colorscheme biscuit | AirlineTheme zenburn
command M colorscheme miasma | AirlineTheme zenburn
command Ml colorscheme melange | AirlineTheme zenburn
command E colorscheme everforest | AirlineTheme zenburn
let g:everforest_enable_italic = 1
let g:everforest_background = 'soft'
let g:gruvbox_material_enable_italic = 1
let g:gruvbox_material_background = 'soft'
colorscheme everforest
try
AirlineTheme zenburn
catch
" autocmd VimEnter defers the command until everything is
" loaded, so it won't complain that AirlineTheme isn't a
" known command
autocmd VimEnter * AirlineTheme zenburn
endtry
" font/typeface (for GUIs, neovide in my case)
set guifont=FantasqueSansM\ Nerd\ Font:h14 " curly k master race
" Vim-Airline options
let g:airline_powerline_fonts = 1
let g:airline_theme='term'
" Editor options
"let g:hardtime_default_on = 0 " Auto-enable vim-hardtime (if set to 1)
set backspace=indent,eol,start " needed for cygwin vim iirc
set ignorecase " Case-insensitive searching
set smartcase " Unless I use a capital in the search intentionally
set smartindent " Use indent sizes used in document at hand
set smarttab " Also recommended for better tab indenting
set magic " Makes vim's regex search patterns line up with grep's
set confirm " Prompts when :w, :q. :wq fail. AFAIK default behaviour
set viminfo='20,\"500 " Copies clipboard registers to .viminfo on quit
set hidden " Remembers undo history after quitting
set history=1000 " MOAR UNDO LEVELS!
set tabstop=2 " Show tabs as 2-space indentation
set shiftwidth=2 expandtab " 'soft tabbing' - Hit TAB but GET 2 spaces
set foldopen -=hor " stop opening folds when I hit 'L'
set nowrap " no line wrapping by default
" Set internal encoding of vim, not needed on neovim, since coc.nvim uses some
" unicode characters in the file autoload/float.vim
set encoding=UTF-8
" TextEdit might fail if hidden is not set.
set hidden
" Some servers have issues with backup files, see #649.
set nobackup
set nowritebackup
" Don't pass messages to |ins-completion-menu|.
" I think this may be unnecessary now TODO check/remove
set shortmess+=c
" Always show the signcolumn, otherwise it would shift the text each time
" diagnostics appear/become resolved.
" I think this may be unnecessary now TODO check/remove
if has("nvim-0.5.0") || has("patch-8.1.1564")
" Recently vim can merge signcolumn and number column into one
set signcolumn=number
else
set signcolumn=yes
endif
" Telescope
nnoremap <leader>ff <cmd>Telescope find_files<cr>
nnoremap <leader>fg <cmd>Telescope live_grep<cr>
nnoremap <leader>fb <cmd>Telescope buffers<cr>
nnoremap <leader>fh <cmd>Telescope help_tags<cr>
" Custom functionality
function! ToggleNvimTree()
let cmd_is_colon = getcmdtype() is# ':'
let cmd_is_t = getcmdline() is# 'T'
return (cmd_is_colon && cmd_is_t) ? 'NvimTreeToggle' : 'T'
endfunction
cnoreabbrev <expr> T ToggleNvimTree()
" Language-specific settings
" enable format-on-save from nvim-lspconfig + ZLS
" Formatting with ZLS matches `zig fmt`.
" The Zig FAQ answers some questions about `zig fmt`:
" https://github.com/ziglang/zig/wiki/FAQ
autocmd BufWritePre *.zig,*.zon lua vim.lsp.buf.format()
" vimscript config above will be run before lua/lua_init.lua
lua require('lua_init')
" Anything in this block will be run last (why not just put
" it in lua/lua_init.lua? I don't know but I might I guess)
lua << EOF
EOF