Skip to content

Instantly share code, notes, and snippets.

@VonHeikemen
Last active February 19, 2026 14:17
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
" NOTE: This configuration uses mini.deps as a plugin manager, meaning we need
" to install that. So, the first step is to figure out where we need to install
" it, run this command on your terminal:
"
" nvim --headless -c 'echo stdpath("data") . "/site/pack/deps/start/"' -c 'quit'
"
" Now navigate to that location and use `git clone` to download mini.nvim
"
" git clone --filter=blob:none https://github.com/nvim-mini/mini.nvim
"
" ============================================================================ "
" === 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 === "
" ============================================================================ "
try
" See :help MiniDeps.config
let DepsConfig = {}
call v:lua.require'mini.deps'.setup(DepsConfig)
catch
let s:msg = split(v:exception, '\n')[0]
echohl WarningMsg | echo s:msg | echohl None
finish
endtry
let DepsAdd = luaeval('MiniDeps.add')
let MkCmd = luaeval('function(str) return function() vim.cmd(str) end end')
call DepsAdd('sainnhe/everforest')
call DepsAdd('folke/which-key.nvim')
call DepsAdd('neovim/nvim-lspconfig')
call DepsAdd('VonHeikemen/ts-enable.nvim')
call DepsAdd({
\ 'source': 'nvim-treesitter/nvim-treesitter',
\ 'checkout': 'main',
\ 'hooks': {
\ 'post_checkout': MkCmd('TSUpdate')
\ }
\})
call DepsAdd({
\ 'source': 'nvim-mini/mini.nvim',
\ 'checkout': 'main',
\})
" ============================================================================ "
" === PLUGIN CONFIG === "
" ============================================================================ "
lua SafeSetup = function(m,c) MiniDeps.now(function() require(m).setup(c) end) end
let Setup = luaeval('SafeSetup')
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(),
\}
" 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