switch vim => nvim
also install some plugins, like vim-surround and fzf
This commit is contained in:
86
modules/universal/env/home-manager.nix
vendored
86
modules/universal/env/home-manager.nix
vendored
@@ -82,12 +82,22 @@ in
|
|||||||
"x-scheme-handler/https" = [ "librewolf.desktop" ];
|
"x-scheme-handler/https" = [ "librewolf.desktop" ];
|
||||||
"x-scheme-handler/about" = [ "librewolf.desktop" ];
|
"x-scheme-handler/about" = [ "librewolf.desktop" ];
|
||||||
"x-scheme-handler/unknown" = [ "librewolf.desktop" ];
|
"x-scheme-handler/unknown" = [ "librewolf.desktop" ];
|
||||||
|
"image/png" = [ "org.gnome.gThumb.desktop" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# convenience
|
# convenience
|
||||||
home.file."knowledge".source = config.lib.file.mkOutOfStoreSymlink "/home/colin/dev/knowledge";
|
home.file."knowledge".source = config.lib.file.mkOutOfStoreSymlink "/home/colin/dev/knowledge";
|
||||||
home.file."nixos".source = config.lib.file.mkOutOfStoreSymlink "/home/colin/dev/nixos";
|
home.file."nixos".source = config.lib.file.mkOutOfStoreSymlink "/home/colin/dev/nixos";
|
||||||
|
|
||||||
|
# nb markdown/personal knowledge manager
|
||||||
|
home.file.".nb/knowledge".source = config.lib.file.mkOutOfStoreSymlink "/home/colin/dev/knowledge";
|
||||||
|
home.file.".nb/.current".text = "knowledge";
|
||||||
|
home.file.".nbrc".text = ''
|
||||||
|
# manage with `nb settings`
|
||||||
|
export NB_AUTO_SYNC=0
|
||||||
|
'';
|
||||||
|
|
||||||
|
# aerc TUI mail client
|
||||||
xdg.configFile."aerc/accounts.conf".source =
|
xdg.configFile."aerc/accounts.conf".source =
|
||||||
config.lib.file.mkOutOfStoreSymlink sysconfig.sops.secrets.aerc_accounts.path;
|
config.lib.file.mkOutOfStoreSymlink sysconfig.sops.secrets.aerc_accounts.path;
|
||||||
|
|
||||||
@@ -137,39 +147,63 @@ in
|
|||||||
userEmail = "colin@uninsane.org";
|
userEmail = "colin@uninsane.org";
|
||||||
};
|
};
|
||||||
|
|
||||||
vim = {
|
neovim = {
|
||||||
|
# neovim: https://github.com/neovim/neovim
|
||||||
enable = true;
|
enable = true;
|
||||||
extraConfig = ''
|
viAlias = true;
|
||||||
" wtf vim project: NOBODY LIKES MOUSE FOR VISUAL MODE
|
vimAlias = true;
|
||||||
set mouse-=a
|
plugins = with pkgs.vimPlugins; [
|
||||||
|
# docs: surround-nvim: https://github.com/ur4ltz/surround.nvim/
|
||||||
|
# docs: vim-surround: https://github.com/tpope/vim-surround
|
||||||
|
vim-surround
|
||||||
|
# docs: fzf-vim (fuzzy finder): https://github.com/junegunn/fzf.vim
|
||||||
|
fzf-vim
|
||||||
|
# treesitter syntax highlighting: https://nixos.wiki/wiki/Tree_sitters
|
||||||
|
# config taken from: https://github.com/i077/system/blob/master/modules/home/neovim/default.nix
|
||||||
|
# this is required for tree-sitter to even highlight
|
||||||
|
({
|
||||||
|
plugin = (nvim-treesitter.withPlugins (_: pkgs.tree-sitter.allGrammars));
|
||||||
|
type = "lua";
|
||||||
|
config = ''
|
||||||
|
require'nvim-treesitter.configs'.setup {
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
disable = {}
|
||||||
|
},
|
||||||
|
incremental_selection = {
|
||||||
|
enable = true,
|
||||||
|
keymaps = {
|
||||||
|
init_selection = "gnn",
|
||||||
|
node_incremental = "grn",
|
||||||
|
mcope_incremental = "grc",
|
||||||
|
node_decremental = "grm"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
indent = {
|
||||||
|
enable = true,
|
||||||
|
disable = {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.o.foldmethod = 'expr'
|
||||||
|
vim.o.foldexpr = 'nvim_treesitter#foldexpr()'
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
];
|
||||||
|
extraConfig = ''
|
||||||
" copy/paste to system clipboard
|
" copy/paste to system clipboard
|
||||||
set clipboard=unnamedplus
|
set clipboard=unnamedplus
|
||||||
|
|
||||||
" swap files stored out-of-tree.
|
" at least don't open files with sections folded by default
|
||||||
" // means to encode swap files in this dir by absolute fs path to avoid collisions
|
set nofoldenable
|
||||||
set directory^=$HOME/${vim-swap-dir}//
|
|
||||||
|
|
||||||
" <tab> completion menu settings
|
" horizontal rule under the active line
|
||||||
set wildmenu
|
" set cursorline
|
||||||
set wildmode=longest,list,full
|
|
||||||
|
|
||||||
" highlight all matching searches (using / and ?)
|
" highlight trailing space & related syntax errors (doesn't seem to work??)
|
||||||
set hlsearch
|
" let c_space_errors=1
|
||||||
|
" let python_space_errors=1
|
||||||
" allow backspace to delete empty lines in insert mode
|
'';
|
||||||
set backspace=indent,eol,start
|
|
||||||
|
|
||||||
" built-in syntax highlighting
|
|
||||||
syntax enable
|
|
||||||
|
|
||||||
" show line/col number in bottom right
|
|
||||||
set ruler
|
|
||||||
|
|
||||||
" highlight trailing space & related syntax errors (does this work?)
|
|
||||||
let c_space_errors=1
|
|
||||||
let python_space_errors=1
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
firefox = lib.mkIf (sysconfig.colinsane.gui.enable) {
|
firefox = lib.mkIf (sysconfig.colinsane.gui.enable) {
|
||||||
|
Reference in New Issue
Block a user