mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-08 03:11:36 +00:00
modules/autopairs
feat: apply new module format to nvim-autopairs
This commit is contained in:
parent
f567b08e92
commit
b917526be7
8 changed files with 325 additions and 268 deletions
103
modules/basic/config.nix
Normal file
103
modules/basic/config.nix
Normal file
|
@ -0,0 +1,103 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with builtins; let
|
||||
cfg = config.vim;
|
||||
in {
|
||||
config = {
|
||||
vim.startPlugins = ["plenary-nvim"];
|
||||
|
||||
vim.nmap = mkIf cfg.disableArrows {
|
||||
"<up>" = "<nop>";
|
||||
"<down>" = "<nop>";
|
||||
"<left>" = "<nop>";
|
||||
"<right>" = "<nop>";
|
||||
};
|
||||
|
||||
vim.imap = mkIf cfg.disableArrows {
|
||||
"<up>" = "<nop>";
|
||||
"<down>" = "<nop>";
|
||||
"<left>" = "<nop>";
|
||||
"<right>" = "<nop>";
|
||||
};
|
||||
|
||||
vim.nnoremap = mkIf cfg.mapLeaderSpace {"<space>" = "<nop>";};
|
||||
|
||||
vim.configRC.basic = nvim.dag.entryAfter ["globalsScript"] ''
|
||||
" Settings that are set for everything
|
||||
set encoding=utf-8
|
||||
set mouse=${cfg.mouseSupport}
|
||||
set tabstop=${toString cfg.tabWidth}
|
||||
set shiftwidth=${toString cfg.tabWidth}
|
||||
set softtabstop=${toString cfg.tabWidth}
|
||||
set expandtab
|
||||
set cmdheight=${toString cfg.cmdHeight}
|
||||
set updatetime=${toString cfg.updateTime}
|
||||
set shortmess+=c
|
||||
set tm=${toString cfg.mapTimeout}
|
||||
set hidden
|
||||
${optionalString cfg.splitBelow ''
|
||||
set splitbelow
|
||||
''}
|
||||
${optionalString cfg.splitRight ''
|
||||
set splitright
|
||||
''}
|
||||
${optionalString cfg.showSignColumn ''
|
||||
set signcolumn=yes
|
||||
''}
|
||||
${optionalString cfg.autoIndent ''
|
||||
set autoindent
|
||||
''}
|
||||
|
||||
${optionalString cfg.preventJunkFiles ''
|
||||
set noswapfile
|
||||
set nobackup
|
||||
set nowritebackup
|
||||
''}
|
||||
${optionalString (cfg.bell == "none") ''
|
||||
set noerrorbells
|
||||
set novisualbell
|
||||
''}
|
||||
${optionalString (cfg.bell == "on") ''
|
||||
set novisualbell
|
||||
''}
|
||||
${optionalString (cfg.bell == "visual") ''
|
||||
set noerrorbells
|
||||
''}
|
||||
${optionalString (cfg.lineNumberMode == "relative") ''
|
||||
set relativenumber
|
||||
''}
|
||||
${optionalString (cfg.lineNumberMode == "number") ''
|
||||
set number
|
||||
''}
|
||||
${optionalString (cfg.lineNumberMode == "relNumber") ''
|
||||
set number relativenumber
|
||||
''}
|
||||
${optionalString cfg.useSystemClipboard ''
|
||||
set clipboard+=unnamedplus
|
||||
''}
|
||||
${optionalString cfg.mapLeaderSpace ''
|
||||
let mapleader=" "
|
||||
let maplocalleader=" "
|
||||
''}
|
||||
${optionalString cfg.syntaxHighlighting ''
|
||||
syntax on
|
||||
''}
|
||||
${optionalString (!cfg.wordWrap) ''
|
||||
set nowrap
|
||||
''}
|
||||
${optionalString cfg.hideSearchHighlight ''
|
||||
set nohlsearch
|
||||
set incsearch
|
||||
''}
|
||||
${optionalString cfg.colourTerm ''
|
||||
set termguicolors
|
||||
set t_Co=256
|
||||
''}
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue