diff --git a/config/users/kat/base/vim/default.nix b/config/users/kat/base/vim/default.nix index 00ad4037..85c362f4 100644 --- a/config/users/kat/base/vim/default.nix +++ b/config/users/kat/base/vim/default.nix @@ -1,15 +1,16 @@ { config, lib, pkgs, ... }: { - home.sessionVariables.EDITOR = "vim"; - programs.vim = { + home.sessionVariables.EDITOR = "nvim"; + + programs.neovim = { enable = true; - settings = { }; - package = pkgs.vim_configurable-pynvim; - #withPython3 = true; + extraConfig = import ./vimrc.nix { inherit pkgs config; }; + vimAlias = true; + viAlias = true; plugins = with pkgs.vimPlugins; [ - nerdtree vim-nix + notmuch-vim rust-vim coc-nvim coc-rust-analyzer @@ -27,33 +28,23 @@ vim-lastplace base16-vim ]; - #extraPackages = with pkgs; - # [ (python3.withPackages (ps: with ps; [ black flake8 ])) ]; - #extraPython3Packages = (ps: with ps; [ jedi pylint ]); - extraConfig = import ./vimrc.nix { inherit pkgs config; }; - }; - xdg.dataFile = { - "vim/undo/.keep".text = ""; - "vim/swap/.keep".text = ""; - "vim/backup/.keep".text = ""; - }; - xdg.configFile = { - "vim/coc/coc-settings.json".text = builtins.toJSON { - "rust.rustfmt_path" = "${pkgs.rustfmt}/bin/rustfmt"; - "rust-analyzer.serverPath" = "rust-analyzer"; - "rust-analyzer.updates.prompt" = false; - "rust-analyzer.notifications.cargoTomlNotFound" = false; - "rust-analyzer.notifications.workspaceLoaded" = false; - "rust-analyzer.procMacro.enable" = true; - "rust-analyzer.cargo.loadOutDirsFromCheck" = true; - "rust-analyzer.cargo-watch.enable" = - true; - "rust-analyzer.completion.addCallParenthesis" = - false; # consider using this? - "rust-analyzer.hoverActions.linksInHover" = true; - "rust-analyzer.diagnostics.disabled" = [ - "inactive-code" # it has strange cfg support..? - ]; + coc = { + enable = true; + settings = { + "rust.rustfmt_path" = "${pkgs.rustfmt}/bin/rustfmt"; + "rust-analyzer.serverPath" = "rust-analyzer"; + "rust-analyzer.updates.prompt" = false; + "rust-analyzer.notifications.cargoTomlNotFound" = false; + "rust-analyzer.notifications.workspaceLoaded" = false; + "rust-analyzer.procMacro.enable" = true; + "rust-analyzer.cargo.loadOutDirsFromCheck" = true; + "rust-analyzer.cargo-watch.enable" = true; + "rust-analyzer.completion.addCallParenthesis" = false; # consider using this? + "rust-analyzer.hoverActions.linksInHover" = true; + "rust-analyzer.diagnostics.disabled" = [ + "inactive-code" # it has strange cfg support..? + ]; + }; }; }; } diff --git a/config/users/kat/base/vim/vimrc.nix b/config/users/kat/base/vim/vimrc.nix index 297ef935..aca3f07b 100644 --- a/config/users/kat/base/vim/vimrc.nix +++ b/config/users/kat/base/vim/vimrc.nix @@ -8,9 +8,8 @@ ''}"; " Enable mouse set mouse=a - set ttymouse=sgr - set viminfo='100000,<100000,s1000,h,n$XDG_DATA_HOME/vim/viminfo + set viminfo='100000,<100000,s1000,h,n$XDG_DATA_HOME/vim/viminfo' " colors let base16colorspace=256 @@ -23,7 +22,7 @@ " tabline let g:airline#extensions#tabline#enabled = 1 - " notmuch! + " notmuch! let g:notmuch_config_file='${config.xdg.configHome}/notmuch/notmuchrc' let g:notmuch_folders_count_threads=0 let g:notmuch_date_format='%y-%m-%d %H:%M' @@ -32,18 +31,9 @@ let g:notmuch_search_date_format='%Y/%m/%d %H:%M' let g:notmuch_html_converter='${pkgs.elinks}/bin/elinks --dump' - " lastplace + " lastplace let g:lastplace_ignore = "gitcommit,gitrebase,svn,hgcommit" - autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | - \ quit | endif - autocmd BufEnter * if bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_tree_\d\+' && winnr('$') > 1 | - \ let buf=bufnr() | buffer# | execute "normal! \w" | execute 'buffer'.buf | endif - nnoremap n :NERDTreeFocus - nnoremap :NERDTree - nnoremap :NERDTreeToggle - nnoremap :NERDTreeFind - let g:coc_node_path='${pkgs.nodejs}/bin/node' let g:coc_config_home=$XDG_CONFIG_HOME . '/vim/coc' @@ -64,7 +54,7 @@ set hlsearch set relativenumber set completeopt=longest,menuone - + command Spaces set expandtab command Tabs set noexpandtab @@ -200,10 +190,4 @@ nnoremap k :CocPrev " Resume latest coc list. nnoremap p :CocListResume - -'' + (if config.wayland.windowManager.sway.enable then '' - noremap "+y y:call system("wl-copy", @") - nnoremap "+p :let @"=substitute(system("wl-paste --no-newline"), '', ''', 'g')p - nnoremap "*p :let @"=substitute(system("wl-paste --no-newline --primary"), '', ''', 'g')p -'' else - "") +'' diff --git a/nix/sources.json b/nix/sources.json index 3b23e346..174faff4 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -5,10 +5,10 @@ "homepage": null, "owner": "arcnmx", "repo": "nixexprs", - "rev": "d321fb6c1675545007d6f5486a50f67d8a5a8836", - "sha256": "194w6cs5qwv6xfslni013afdc3jyawg8h7mqywg82qxwmvipngjp", + "rev": "4ebb785dde22feae297e5c51b7175f4e78f0d816", + "sha256": "1hslmzgjdfwdzcms56px8g06mk1q7k6yxiwk1g9i9kwsb62p6a9l", "type": "tarball", - "url": "https://github.com/arcnmx/nixexprs/archive/d321fb6c1675545007d6f5486a50f67d8a5a8836.tar.gz", + "url": "https://github.com/arcnmx/nixexprs/archive/4ebb785dde22feae297e5c51b7175f4e78f0d816.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "ci": {