minimal vimrc and better xdg support thanks to b3nj5m1n/xdg-ninja

This commit is contained in:
js0ny 2024-11-13 00:38:35 +00:00
parent 1ef5283598
commit 165037d840
11 changed files with 109 additions and 5 deletions

View file

@ -1,5 +1,5 @@
# $XDG_CONFIG_HOME/git/config
# ln -sf $DOTFILES/.config/git/.gitconfig $XDG_CONFIG_HOME/git/.config
# ln -sf $DOTFILES/.config/git/.gitconfig $XDG_CONFIG_HOME/git/config
# New-Item -ItemType SymbolicLink -Path "$Env:XDG_CONFIG_HOME\git\config" -Target "$DOTFILES\.config\git\.gitconfig"
[user]
name = js0ny

13
.config/lesskey Normal file
View file

@ -0,0 +1,13 @@
# $XDG_CONFIG_HOME/lesskey -- less options
# ln -sf $DOTFILES/.config/lesskey $XDG_CONFIG_HOME/lesskey
# Ne
# Format: key action
# Arrow Remap (hnei -> hjkl)
n forw-line
e back-line
# search with k : ne[k]st
k repeat-search
K reverse-search

4
.config/npm/.npmrc Normal file
View file

@ -0,0 +1,4 @@
# ~/.npmrc
# New-Item -ItemType SymbolicLink -Path ~\.npmrc -Target ~\.dotfiles\.npmrc
# ln -s $DOTFILES/.npmrc ~/.npmrc
# registry=https://registry.npmmirror.com

4
.config/npm/npmrc Normal file
View file

@ -0,0 +1,4 @@
# export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME"/npm/npmrc
# $XDG_CONFIG_HOME/npm/npmrc
# ln -s $DOTFILES/.config/npm/npmrc $NPM_CONFIG_USERCONFIG
# registry=https://registry.npmmirror.com

37
.config/tmux/tmux.conf Normal file
View file

@ -0,0 +1,37 @@
# Prefix
# -----------------
set-option -g prefix C-x
unbind C-b
bind C-x send-prefix
# Index
# -----------------
set -g base-index 1
set -g pane-base-index 1
# History
# -----------------
set -g history-limit 4096
# Reload Config
# -----------------
bind r source-file ~/.tmux.conf \; display "Reloaded Config"
# Vi Mode
# -----------------
set -g status-keys vi
set-window-option -g mode-keys vi
# Windows Management
# -----------------
bind | split-window -h
unbind '"'
bind - split-window -v
unbind %
bind h select-pane -L
bind n select-pane -D
bind e select-pane -U
bind i select-pane -R

52
.config/vim/vimrc Normal file
View file

@ -0,0 +1,52 @@
" $XDG_CONFIG_HOME/vim/vimrc
" This is a minimal setup of vimrc
" ln -sf $DOTFILES/.config/vim/vimrc $XDG_CONFIG_HOME/vim/vimrc
" Colemak Keys
" Arrow remap
noremap n j
noremap e k
noremap i l
" Similar position to i
noremap l i
noremap L I
" ne[k]st
noremap k n
noremap K N
" [j]ump
noremap j e
noremap J E
" Normal minimal setup
noremap Y y$
set expandtab
set tabstop=4
set shiftwidth=4
set autoindent
set smartindent
set wrap
set scrolloff=3
set hlsearch
set incsearch
est ignorecase
set smartcase
" XDG Directory Specifications
" Reference to https://jorenar.com/blog/vim-xdg
if empty($XDG_CACHE_HOME) | let $XDG_CACHE_HOME = $HOME."/.cache" | endif
if empty($XDG_CONFIG_HOME) | let $XDG_CONFIG_HOME = $HOME."/.config" | endif
if empty($XDG_DATA_HOME) | let $XDG_DATA_HOME = $HOME."/.local/share" | endif
if empty($XDG_STATE_HOME) | let $XDG_STATE_HOME = $HOME."/.local/state" | endif
set viminfo+=n$XDG_STATE_HOME/vim/viminfo
set packpath^=$XDG_DATA_HOME/vim
set packpath+=$XDG_DATA_HOME/vim/after
set backupdir=$XDG_STATE_HOME/vim/backup
set directory=$XDG_STATE_HOME/vim/swap
set undodir=$XDG_STATE_HOME/vim/undo
set viewdir=$XDG_STATE_HOME/vim/view
set shada+=n$XDG_STATE_HOME/vim/shada