[vim] Move into user config
This commit is contained in:
parent
e378e97534
commit
cf9058cc48
7 changed files with 76 additions and 2984 deletions
|
@ -4,7 +4,6 @@
|
||||||
imports = [
|
imports = [
|
||||||
./apps
|
./apps
|
||||||
./shells
|
./shells
|
||||||
./utils
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# Nix Flakes
|
# Nix Flakes
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./vim
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -1,81 +0,0 @@
|
||||||
{ inputs, lib, config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
home-manager.users.tdpeuter = { pkgs, ... }: {
|
|
||||||
home.file = {
|
|
||||||
".vim".source = ../../../../stow/vim/.vim;
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.vim = {
|
|
||||||
enable = true;
|
|
||||||
extraConfig = ''
|
|
||||||
colorscheme tdpeuter-light
|
|
||||||
|
|
||||||
" Tags
|
|
||||||
" pacman -S ctags
|
|
||||||
command! MakeTags !ctags -R . &
|
|
||||||
" Move to defintion using ^]
|
|
||||||
" Move to ambigious using g^]
|
|
||||||
" Move back using ^t
|
|
||||||
|
|
||||||
filetype on
|
|
||||||
filetype indent on
|
|
||||||
filetype plugin on
|
|
||||||
|
|
||||||
" File browsing
|
|
||||||
let g:netrw_browse_split=4 " open in the previous window
|
|
||||||
let g:netrw_altv=1 " split new windows to the right
|
|
||||||
let g:netrw_liststyle=3 " treeview
|
|
||||||
|
|
||||||
set autoindent
|
|
||||||
set conceallevel=2
|
|
||||||
set incsearch
|
|
||||||
set linebreak
|
|
||||||
set nocompatible
|
|
||||||
set path+=**
|
|
||||||
set scrolloff=3
|
|
||||||
set showcmd
|
|
||||||
set showmatch
|
|
||||||
set smartindent
|
|
||||||
set smarttab
|
|
||||||
set title
|
|
||||||
set wildignore=*.docx,*.jpg,*.png,*.gif,*.pdf,*.pyc,*.exe,*.flv,*.img,*.xlsx
|
|
||||||
set wildmenu
|
|
||||||
|
|
||||||
syntax enable
|
|
||||||
|
|
||||||
if $TERM == 'alacritty'
|
|
||||||
set ttymouse=sgr " Alacritty specific
|
|
||||||
endif
|
|
||||||
if $TERM == 'xterm-kitty'
|
|
||||||
" Fix <HOME> and <END> not working
|
|
||||||
set term=xterm-256color
|
|
||||||
endif
|
|
||||||
|
|
||||||
if has("autocmd")
|
|
||||||
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
|
|
||||||
" https://stackoverflow.com/a/37558470/19044747
|
|
||||||
augroup remember_folds
|
|
||||||
autocmd!
|
|
||||||
autocmd BufWinLeave * silent! mkview
|
|
||||||
autocmd BufWinEnter * silent! loadview
|
|
||||||
augroup END
|
|
||||||
endif
|
|
||||||
'';
|
|
||||||
plugins = with pkgs.vimPlugins; [
|
|
||||||
ale
|
|
||||||
catppuccin-vim
|
|
||||||
statix
|
|
||||||
vifm-vim
|
|
||||||
];
|
|
||||||
settings = {
|
|
||||||
expandtab = true;
|
|
||||||
mouse = "a";
|
|
||||||
number = true;
|
|
||||||
relativenumber = true;
|
|
||||||
shiftwidth = 4;
|
|
||||||
tabstop = 4;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -32,7 +32,7 @@ in {
|
||||||
home = {
|
home = {
|
||||||
username = user;
|
username = user;
|
||||||
homeDirectory = "/home/${user}";
|
homeDirectory = "/home/${user}";
|
||||||
stateVersion = config.system.stateVersion;
|
inherit (config.system) stateVersion;
|
||||||
|
|
||||||
# If you specify an application here, it will be detected by the configuration module
|
# If you specify an application here, it will be detected by the configuration module
|
||||||
# and the configuration files will be put in place for you.
|
# and the configuration files will be put in place for you.
|
||||||
|
@ -55,6 +55,9 @@ in {
|
||||||
zellij # Tmux + screen alternative
|
zellij # Tmux + screen alternative
|
||||||
]) ++ (with pkgs-unstable; [
|
]) ++ (with pkgs-unstable; [
|
||||||
mpv
|
mpv
|
||||||
|
]) ++ (with pkgs.vimPlugins; [
|
||||||
|
statix
|
||||||
|
vim-plug
|
||||||
]);
|
]);
|
||||||
|
|
||||||
# Put dotfiles in place.
|
# Put dotfiles in place.
|
||||||
|
@ -74,19 +77,23 @@ in {
|
||||||
".ssh/config" = lib.mkIf config.sisyphus.programs.ssh.enable {
|
".ssh/config" = lib.mkIf config.sisyphus.programs.ssh.enable {
|
||||||
source = ../../../../stow/ssh/.ssh/config;
|
source = ../../../../stow/ssh/.ssh/config;
|
||||||
};
|
};
|
||||||
# Put Vifm files separately so history fill still works.
|
".config/vifm" = lib.mkIf (builtins.elem pkgs.vifm installedPkgs) {
|
||||||
".config/vifm/colors" = lib.mkIf (builtins.elem pkgs.vifm installedPkgs) {
|
source = ../../../../stow/vifm/.config/vifm;
|
||||||
source = ../../../../stow/vifm/.config/vifm/colors;
|
recursive = true;
|
||||||
};
|
|
||||||
".config/vifm/scripts" = lib.mkIf (builtins.elem pkgs.vifm installedPkgs) {
|
|
||||||
source = ../../../../stow/vifm/.config/vifm/scripts;
|
|
||||||
};
|
|
||||||
".config/vifm/vifmrc" = lib.mkIf (builtins.elem pkgs.vifm installedPkgs) {
|
|
||||||
source = ../../../../stow/vifm/.config/vifm/vifmrc;
|
|
||||||
};
|
};
|
||||||
".config/zellij" = lib.mkIf (builtins.elem pkgs.zellij installedPkgs) {
|
".config/zellij" = lib.mkIf (builtins.elem pkgs.zellij installedPkgs) {
|
||||||
source = ../../../../stow/zellij/.config/zellij;
|
source = ../../../../stow/zellij/.config/zellij;
|
||||||
};
|
};
|
||||||
|
".vim" = lib.mkIf (builtins.elem pkgs.vim installedPkgs) {
|
||||||
|
source = ../../../../stow/vim/.vim;
|
||||||
|
recursive = true;
|
||||||
|
};
|
||||||
|
".vim/autoload/plug.vim" = lib.mkIf (builtins.elem pkgs.vim installedPkgs) {
|
||||||
|
source = "${pkgs.vimPlugins.vim-plug}/plug.vim";
|
||||||
|
};
|
||||||
|
".vimrc" = lib.mkIf (builtins.elem pkgs.vim installedPkgs) {
|
||||||
|
source = ../../../../stow/vim/.vimrc;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -51,7 +51,9 @@ endfun
|
||||||
|
|
||||||
|
|
||||||
" User interface colors {
|
" User interface colors {
|
||||||
call s:h("Normal", s:fg, s:bg, "")
|
" call s:h("Normal", s:fg, s:bg, "")
|
||||||
|
" Transparent background
|
||||||
|
hi Normal guisp=NONE guifg=#383a42 guibg=#1E1E2E ctermfg=237 ctermbg=None gui=NONE cterm=NONE
|
||||||
|
|
||||||
call s:h("Cursor", s:bg, s:blue, "")
|
call s:h("Cursor", s:bg, s:blue, "")
|
||||||
call s:h("CursorColumn", "", s:cursor_line, "")
|
call s:h("CursorColumn", "", s:cursor_line, "")
|
||||||
|
|
130
stow/vim/.vimrc
130
stow/vim/.vimrc
|
@ -2,88 +2,35 @@
|
||||||
" ~/.vimrc
|
" ~/.vimrc
|
||||||
"
|
"
|
||||||
|
|
||||||
filetype on
|
colorscheme tdpeuter-light
|
||||||
filetype plugin on
|
|
||||||
filetype indent on
|
|
||||||
set expandtab
|
|
||||||
set smarttab
|
|
||||||
set smartindent
|
|
||||||
set incsearch
|
|
||||||
set showmatch
|
|
||||||
set title
|
|
||||||
set wildignore=*.docx,*.jpg,*.png,*.gif,*.pdf,*.pyc,*.exe,*.flv,*.img,*.xlsx
|
|
||||||
syntax enable
|
|
||||||
|
|
||||||
" --
|
|
||||||
|
|
||||||
set scrolloff=3
|
|
||||||
set showcmd
|
|
||||||
|
|
||||||
set autoindent
|
set autoindent
|
||||||
set linebreak
|
|
||||||
set shiftwidth=4
|
|
||||||
set tabstop=4
|
|
||||||
|
|
||||||
set number
|
|
||||||
set relativenumber
|
|
||||||
|
|
||||||
set conceallevel=2
|
set conceallevel=2
|
||||||
|
set expandtab
|
||||||
" Add mouse support
|
set incsearch
|
||||||
|
set linebreak
|
||||||
set mouse=a
|
set mouse=a
|
||||||
if $TERM == 'alacritty'
|
|
||||||
set ttymouse=sgr " Alacritty specific
|
|
||||||
endif
|
|
||||||
|
|
||||||
" PLUGINS --------------------------------------------------------------- {{{
|
|
||||||
|
|
||||||
call plug#begin('~/.vim/plugged')
|
|
||||||
|
|
||||||
Plug 'dense-analysis/ale'
|
|
||||||
Plug 'https://github.com/vifm/vifm.vim.git'
|
|
||||||
Plug 'catppuccin/vim', { 'as': 'catppuccin' }
|
|
||||||
|
|
||||||
call plug#end()
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
colorscheme catppuccin_mocha_mod
|
|
||||||
|
|
||||||
" AUTOMATIC STUFF ------------------------------------------------------- {{{
|
|
||||||
|
|
||||||
if has("autocmd")
|
|
||||||
|
|
||||||
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
|
|
||||||
|
|
||||||
" https://stackoverflow.com/a/37558470/19044747
|
|
||||||
augroup remember_folds
|
|
||||||
autocmd!
|
|
||||||
autocmd BufWinLeave * silent! mkview
|
|
||||||
autocmd BufWinEnter * silent! loadview
|
|
||||||
augroup END
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
" TALK ------------------------------------------------------------------ {{{
|
|
||||||
" https://youtu.be/XA2WjJbmmoM ----------------------------------------------
|
|
||||||
|
|
||||||
set nocompatible
|
set nocompatible
|
||||||
|
set number
|
||||||
" Finding files using :find <name>
|
|
||||||
set path+=**
|
set path+=**
|
||||||
" Also use :b to select files in buffer
|
set relativenumber
|
||||||
|
set scrolloff=3
|
||||||
" Show suggestions on another line instead of inplace
|
set shiftwidth=4
|
||||||
|
set showcmd
|
||||||
|
set showmatch
|
||||||
|
set smartindent
|
||||||
|
set smarttab
|
||||||
|
set tabstop=4
|
||||||
|
set title
|
||||||
|
set wildignore=*.docx,*.jpg,*.png,*.gif,*.pdf,*.pyc,*.exe,*.flv,*.img,*.xlsx
|
||||||
|
"" Show suggestions on another line instead of inplace
|
||||||
set wildmenu
|
set wildmenu
|
||||||
|
|
||||||
" Tags
|
syntax enable
|
||||||
" pacman -S ctags
|
|
||||||
command! MakeTags !ctags -R . &
|
filetype on
|
||||||
" Move to defintion using ^]
|
filetype indent on
|
||||||
" Move to ambigious using g^]
|
filetype plugin on
|
||||||
" Move back using ^t
|
|
||||||
|
|
||||||
" File browsing
|
" File browsing
|
||||||
let g:netrw_browse_split=4 " open in the previous window
|
let g:netrw_browse_split=4 " open in the previous window
|
||||||
|
@ -96,4 +43,39 @@ let g:netrw_liststyle=3 " treeview
|
||||||
" ^p previous
|
" ^p previous
|
||||||
" ^x^f filename completion
|
" ^x^f filename completion
|
||||||
|
|
||||||
|
if $TERM == 'alacritty'
|
||||||
|
set ttymouse=sgr " Alacritty specific
|
||||||
|
endif
|
||||||
|
if $TERM == 'xterm-kitty'
|
||||||
|
" Fix <HOME> and <END> not working
|
||||||
|
set term=xterm-256color
|
||||||
|
endif
|
||||||
|
|
||||||
|
" AUTO ------------------------------------------------------------------ {{{
|
||||||
|
|
||||||
|
if has("autocmd")
|
||||||
|
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
|
||||||
|
|
||||||
|
" https://stackoverflow.com/a/37558470/19044747
|
||||||
|
augroup remember_folds
|
||||||
|
autocmd!
|
||||||
|
autocmd BufWinLeave * silent! mkview
|
||||||
|
autocmd BufWinEnter * silent! loadview
|
||||||
|
augroup END
|
||||||
|
endif
|
||||||
|
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
|
" PLUGINS --------------------------------------------------------------- {{{
|
||||||
|
|
||||||
|
call plug#begin()
|
||||||
|
|
||||||
|
Plug 'dense-analysis/ale'
|
||||||
|
Plug 'vifm/vifm.vim'
|
||||||
|
Plug 'catppuccin/vim', { 'as': 'catppuccin' }
|
||||||
|
Plug 'NerdyPepper/statix'
|
||||||
|
|
||||||
|
call plug#end()
|
||||||
|
|
||||||
|
" }}}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue