Skip to content

Instantly share code, notes, and snippets.

@VonHeikemen
Last active March 16, 2026 01:27
Show Gist options
  • Select an option

  • Save VonHeikemen/fc7aa25941fd34b045512ba2fb633fc9 to your computer and use it in GitHub Desktop.

Select an option

Save VonHeikemen/fc7aa25941fd34b045512ba2fb633fc9 to your computer and use it in GitHub Desktop.
" NOTE: Neovim v0.11 or greater is needed
" ============================================================================ "
" === EDITOR SETTINGS === "
" ============================================================================ "
set number
set ignorecase
set smartcase
set hlsearch
set tabstop=2
set shiftwidth=2
set noshowmode
set termguicolors
set updatetime=250
set timeoutlen=300
set signcolumn=yes
set winborder=rounded
" Space as leader key
let mapleader= ' '
" Basic clipboard interaction
" gy to copy; gp to paste
nnoremap gy "+y
xnoremap gy "+y
nnoremap gp "+p
xnoremap gp "+p
" ============================================================================ "
" === PLUGINS === "
" ============================================================================ "
let s:vimplug_path = stdpath('data') . '/site/pack/junegunn/start/vim-plug/autoload'
let s:vimplug_ready = v:true
if !isdirectory(s:vimplug_path)
echo "Installing vim-plug...."
call system([
\ 'git', 'clone', '--filter=blob:none',
\ 'https://github.com/junegunn/vim-plug', s:vimplug_path
\])
let s:vimplug_ready = v:false
packadd vim-plug
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin()
Plug 'sainnhe/everforest'
Plug 'folke/which-key.nvim'
Plug 'neovim/nvim-lspconfig'
Plug 'VonHeikemen/ts-enable.nvim'
Plug 'nvim-mini/mini.nvim', {'branch': 'main'}
Plug 'nvim-treesitter/nvim-treesitter', {'branch': 'main', 'do': ':TSUpdate'}
call plug#end()
if !s:vimplug_ready
finish
endif
" ============================================================================ "
" === PLUGIN CONFIG === "
" ============================================================================ "
colorscheme everforest
" See :help ts-enable-config
let g:ts_enable = {
\ 'auto_install': v:true,
\ 'highlights': v:true,
\ 'parsers': v:lua.require'nvim-treesitter'.get_available(),
\}
lua Try = function(f) require('mini.misc').safely('now', f) end
let Setup = luaeval('function(m,c) Try(function() require(m).setup(c) end) end')
" See :help MiniIcons.config
" Change style to 'glyph' if you have a font with fancy icons
call Setup('mini.icons', {'style': 'ascii'})
" See :help MiniStatusline.config
call Setup('mini.statusline', {})
" See :help MiniFiles.config
call Setup('mini.files', {})
function! ToggleExplorer() abort
if v:lua.MiniFiles.close()
return
endif
call v:lua.MiniFiles.open()
endfunction
nnoremap <leader>e <cmd>call ToggleExplorer()<cr>
" See :help MiniPick.config
call Setup('mini.pick', {})
" See available pickers
" :help MiniPick.builtin
" :help MiniExtra.pickers
nnoremap <leader>? <cmd>Pick oldfiles<cr>
nnoremap <leader><space> <cmd>Pick buffers<cr>
nnoremap <leader>ff <cmd>Pick files<cr>
nnoremap <leader>fg <cmd>Pick grep_live<cr>
nnoremap <leader>fd <cmd>Pick diagnostic<cr>
nnoremap <leader>fs <cmd>Pick buf_lines<cr>
" See :help MiniExtra.config
call Setup('mini.extra', {})
" See :help MiniSnippets.config
call Setup('mini.snippets', {})
" See :help MiniCompletion.config
call Setup('mini.completion', {
\ 'lsp_completion': {
\ 'source_func': 'omnifunc',
\ 'auto_setup': v:false,
\ },
\})
" See :help which-key.nvim-which-key-setup
call Setup('which-key', {
\ 'preset': 'helix',
\ 'icons': {
\ 'mappings': v:false,
\ 'keys': {
\ 'Space': 'Space',
\ 'Esc': 'Esc',
\ 'BS': 'Backspace',
\ 'C': 'Ctrl-'
\ },
\ }
\})
" LSP setup
function! LspAttached() abort
nnoremap <buffer> K <cmd>lua vim.lsp.buf.hover()<cr>
nnoremap <buffer> gd <cmd>lua vim.lsp.buf.definition()<cr>
nnoremap <buffer> gq <cmd>lua vim.lsp.buf.format({async = true})<cr>
xnoremap <buffer> gq <cmd>lua vim.lsp.buf.format({async = true})<cr>
setlocal omnifunc=v:lua.MiniCompletion.completefunc_lsp
endfunction
autocmd LspAttach * call LspAttached()
" List of compatible language servers is here:
" https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md
call v:lua.vim.lsp.enable(['gopls', 'rust_analyzer'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment