aboutsummaryrefslogtreecommitdiffstats
path: root/home/dev/neovim.nix
diff options
context:
space:
mode:
Diffstat (limited to 'home/dev/neovim.nix')
-rw-r--r--home/dev/neovim.nix82
1 files changed, 82 insertions, 0 deletions
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 <F5> :UndotreeToggle<CR>
+ 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> <leader><space> :silent :nohlsearch<CR>
+
+ set wrap
+ set textwidth=0
+ set list
+ set listchars=tab:▸\ ,eol:¬
+ set mousehide
+ set mouse=a
+ set cursorline
+ set cursorcolumn
+
+ au VimResized * exe "normal! \<c-w>="
+
+ 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
+ '';
+ };
+}