{ pkgs, ... }: { programs.neovim.enable = true; home-manager.sharedModules = [{ programs.neovim = { enable = true; extraConfig = '' filetype plugin indent on set undofile set spell set number set clipboard=unnamedplus set fileencoding=utf-8 " Ensure that we always save files as utf-8 set fileencodings=utf-8,sjis " Automatically open shiftjis files with their proper encoding set spelllang=en_us,cjk " Don't show errors for CJK characters set noshowmode " Disable the --MODE-- text (enable if not using the status line) set mouse=a set ignorecase " By default use case-insensitive search (combine with smartcase) set smartcase " Make search case-sensitive when using capital letters set scrolloff=1 " The minimal number of rows to show when scrolling up/down set sidescrolloff=5 " The minimal number of columns to show when scrolling left/right set tabstop=4 " Show a tab character as 4 spaces set softtabstop=0 " Edit soft tabs as if they're regular spaces set shiftwidth=4 " Make autoindent appear as 4 spaces map imap map <2-MiddleMouse> imap <2-MiddleMouse> map <3-MiddleMouse> imap <3-MiddleMouse> map <4-MiddleMouse> imap <4-MiddleMouse> highlight Search ctermbg=240 ctermfg=255 highlight IncSearch ctermbg=255 ctermfg=240 let mapleader = ' ' nnoremap e :set nu! nnoremap t :OverCommandLine%s/ nnoremap a :NvimTreeToggle nnoremap f :Files nnoremap g :set hlsearch! nnoremap j :Buffers nnoremap l :Rg nnoremap ; w vnoremap y:silent !notify-send -t 4000 "成果" "$(tango '0')": autocmd BufNewFile,BufRead *.ecr setlocal syntax=html autocmd BufWritePre,FileWritePre * silent! call mkdir(expand(':p:h'), 'p') ''; plugins = with pkgs.vimPlugins; [ { plugin = nvim-tree-lua; type = "lua"; config = '' require("nvim-tree").setup() ''; } { plugin = indent-blankline-nvim; type = "lua"; config = '' require("indent_blankline").setup() ''; } { plugin = gitsigns-nvim; type = "lua"; config = '' require('gitsigns').setup() ''; } { plugin = nvim-web-devicons; type = "lua"; } { plugin = nvim-scrollbar; type = "lua"; config = ''require("scrollbar").setup()''; } { plugin = nvim-lspconfig; type = "lua"; config = " local lspconfig = require('lspconfig') lspconfig.nil_ls.setup {} lspconfig.rust_analyzer.setup {} lspconfig.marksman.setup {} lspconfig.gopls.setup {} lspconfig.lua_ls.setup {} lspconfig.clangd.setup {} lspconfig.texlab.setup {} vim.keymap.set('n', 'e', vim.diagnostic.open_float) vim.keymap.set('n', '[d', vim.diagnostic.goto_prev) vim.keymap.set('n', ']d', vim.diagnostic.goto_next) vim.keymap.set('n', 'q', vim.diagnostic.setloclist) vim.api.nvim_create_autocmd('LspAttach', { group = vim.api.nvim_create_augroup('UserLspConfig', {}), callback = function(ev) local opts = { buffer = ev.buf } vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts) vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts) vim.keymap.set('n', '', vim.lsp.buf.signature_help, opts) vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, opts) vim.keymap.set('n', 'rn', vim.lsp.buf.rename, opts) vim.keymap.set({ 'n', 'v' }, 'ca', vim.lsp.buf.code_action, opts) vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts) end, }) "; } { plugin = nvim-base16; type = "lua"; config = "vim.cmd('colorscheme base16-monokai')"; } { plugin = lualine-nvim; type = "lua"; config = "require('lualine').setup()"; } { plugin = git-blame-nvim; type = "lua"; } { plugin = comment-nvim; type = "lua"; config = ''require('Comment').setup()''; } { plugin = plenary-nvim; type = "lua"; } { plugin = vimtex; config = '' " Disable all keybinds so we can define our own let g:vimtex_mappings_enabled = 0 let g:vimtex_imaps_enabled = 0 let g:vimtex_view_method = 'zathura' let g:vimtex_compiler_latexmk = {'build_dir': '.tex'} " Set the normal keybinds nnoremap f (vimtex-view) nnoremap g (vimtex-compile) nnoremap d (vimtex-env-delete) nnoremap c (vimtex-env-change) ''; } fzf-vim vim-caddyfile vim-graphql vim-pug vim-prisma vim-javascript vim-jsx-pretty vim-vue vim-over vim-endwise rust-vim ]; }; }]; }