From 47ef05ab310bb466300e93d1459370450414fbc4 Mon Sep 17 00:00:00 2001 From: "grm@eyesin.space" Date: Tue, 2 Sep 2025 23:04:24 +0000 Subject: init --- home/dev/neovim.nix | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 home/dev/neovim.nix (limited to 'home/dev/neovim.nix') diff --git a/home/dev/neovim.nix b/home/dev/neovim.nix new file mode 100644 index 0000000..37bdaea --- /dev/null +++ b/home/dev/neovim.nix @@ -0,0 +1,82 @@ +{pkgs, ...}: { + programs.neovim = { + enable = true; + defaultEditor = true; + viAlias = true; + vimAlias = true; + coc.enable = true; + plugins = with pkgs.vimPlugins; [ + NeoSolarized + copilot-vim + fzf-vim + nerdcommenter + vim-airline + vim-airline-themes + vim-go + vim-sleuth + vim-surround + { + plugin = undotree; + config = '' + nnoremap :UndotreeToggle + if has("persistent_undo") + let target_path = expand('~/.local/nvim-undo') + if !isdirectory(target_path) + call mkdir(target_path, "p", 0700) + endif + let &undodir=target_path + set undofile + endif + ''; + } + ]; + extraConfig = '' + filetype off + set nocompatible + set modelines=0 + set encoding=utf-8 + set scrolloff=3 + set wildmode=list:longest + set visualbell + set backspace=indent,eol,start + set laststatus=2 + set number + set history=1000 + set title + set ignorecase + set smartcase + set gdefault + set incsearch + set showmatch + set hlsearch + + let mapleader = "," + nmap :silent :nohlsearch + + set wrap + set textwidth=0 + set list + set listchars=tab:▸\ ,eol:¬ + set mousehide + set mouse=a + set cursorline + set cursorcolumn + + au VimResized * exe "normal! \=" + + augroup vimrc_autocmd + autocmd! + + " jump to the last position when reopening a file + autocmd BufReadPost * + \ if line("'\"") > 1 && line("'\"") <= line("$") | + \ exe "normal! g`\"" | + \ endif + augroup END + + syn on + set background=dark + colorscheme NeoSolarized + ''; + }; +} -- cgit v1.2.3