nix/prog/nvim: add folding

nix/prog/nvim: enable arrows in the insert mode
This commit is contained in:
Dmitriy Pleshevskiy 2022-08-03 12:16:29 +03:00
parent 8b36965078
commit 5fd8136cd1
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215
3 changed files with 63 additions and 17 deletions

View file

@ -59,18 +59,32 @@ set ignorecase " Case insensitive.
set smartcase " Case insensitive if no uppercase letter in pattern, case sensitive otherwise set smartcase " Case insensitive if no uppercase letter in pattern, case sensitive otherwise
" Set up a line limiter for each lang " Set up a line limiter for each lang
au BufNewFile,BufRead *.nix set colorcolumn=101 aug line_limiter
au BufNewFile,BufRead *.vim set colorcolumn=101 au!
au BufNewFile,BufRead *.ts,*.tsx set colorcolumn=101 au BufNewFile,BufRead *.nix setlocal colorcolumn=101
au BufNewFile,BufRead *.js,*.jsx set colorcolumn=101 au BufNewFile,BufRead *.vim setlocal colorcolumn=101
au BufNewFile,BufRead *.rs set colorcolumn=101 au BufNewFile,BufRead *.ts,*.tsx setlocal colorcolumn=101
au BufNewFile,BufRead *.json set colorcolumn=81 au BufNewFile,BufRead *.js,*.jsx setlocal colorcolumn=101
au BufNewFile,BufRead *.yml,*.yaml set colorcolumn=81 au BufNewFile,BufRead *.rs setlocal colorcolumn=101
au BufNewFile,BufRead *.md set colorcolumn=81 au BufNewFile,BufRead *.json setlocal colorcolumn=81
" TODO: add limiter for haskell au BufNewFile,BufRead *.yml,*.yaml setlocal colorcolumn=81
au BufNewFile,BufRead *.md setlocal colorcolumn=81
" TODO: add limiter for haskell
aug END
" Spell check for markdown files " Spell check for markdown files
au BufNewFile,BufRead *.md set spell aug spell_check
au!
au BufNewFile,BufRead *.md setlocal spell
aug END
" Set up folding
aug folding
au!
au BufNewFile,BufRead *.js,*.jsx syntax on | setlocal foldmethod=syntax
au BufNewFile,BufRead *.ts,*.tsx syntax on | setlocal foldmethod=syntax
au BufNewFile,BufRead *.rs syntax on | setlocal foldmethod=syntax
aug END
" Enable fast navigation between windows " Enable fast navigation between windows
nnoremap <C-h> <C-W>h nnoremap <C-h> <C-W>h
@ -82,24 +96,27 @@ nnoremap <C-k> <C-W>k
nnoremap Q <nop> nnoremap Q <nop>
nnoremap gQ <nop> nnoremap gQ <nop>
" Disable arrow keys and page up / down " Disable arrow keys
noremap <Up> <nop> noremap <Up> <nop>
noremap <Down> <nop> noremap <Down> <nop>
noremap <Left> <nop> noremap <Left> <nop>
noremap <Right> <nop> noremap <Right> <nop>
inoremap <Up> <nop>
inoremap <Down> <nop>
inoremap <Left> <nop>
inoremap <Right> <nop>
vnoremap <Up> <nop> vnoremap <Up> <nop>
vnoremap <Down> <nop> vnoremap <Down> <nop>
vnoremap <Left> <nop> vnoremap <Left> <nop>
vnoremap <Right> <nop> vnoremap <Right> <nop>
"... instead of insert mode for rus lang
"inoremap <Up> <nop>
"inoremap <Down> <nop>
"inoremap <Left> <nop>
"inoremap <Right> <nop>
" Disable page up / down
noremap <PageUp> <nop> noremap <PageUp> <nop>
inoremap <PageUp> <nop>
vnoremap <PageUp> <nop>
noremap <PageDown> <nop> noremap <PageDown> <nop>
inoremap <PageUp> <nop>
inoremap <PageDown> <nop> inoremap <PageDown> <nop>
vnoremap <PageUp> <nop>
vnoremap <PageDown> <nop> vnoremap <PageDown> <nop>
" Disable mouse / touchpad (only in vim) " Disable mouse / touchpad (only in vim)

View file

@ -0,0 +1,28 @@
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.progs.xplr;
in
{
options.progs.xplr = {
enable = mkOption {
type = types.bool;
default = false;
description = "Add and configure xplr, a terminal UI based file explorer";
};
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
xplr # a terminal UI based file explorer
];
xdg.configFile = {
"xplr/init.lua".source = ./init.lua;
};
};
}

1
nix/progs/xplr/init.lua Normal file
View file

@ -0,0 +1 @@
version = "0.18.0"