From 14d624ea44f3e112f613b858d380f560ffdaec87 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 2 Jun 2022 11:16:39 +0200 Subject: xdg: vim --- .bash_profile | 1 + .bashrc | 2 +- .config/vim/vimrc | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ .vim/vimrc | 87 ---------------------------------------------- 4 files changed, 104 insertions(+), 88 deletions(-) create mode 100644 .config/vim/vimrc delete mode 100644 .vim/vimrc diff --git a/.bash_profile b/.bash_profile index 2c2d5a5..8a0217a 100644 --- a/.bash_profile +++ b/.bash_profile @@ -29,6 +29,7 @@ export CM_LAUNCHER=rofi export CM_SELECTIONS=clipboard export CM_DIR=/tmp export PF_INFO="ascii title os kernel uptime pkgs memory" +export VIMINIT='let $MYVIMRC = !has("nvim") ? "$XDG_CONFIG_HOME/vim/vimrc" : "$XDG_CONFIG_HOME/nvim/init.lua" | so $MYVIMRC' export LESS_TERMCAP_mb=$'\E[1;31m' export LESS_TERMCAP_md=$'\E[1;31m' diff --git a/.bashrc b/.bashrc index 83d9581..0902233 100644 --- a/.bashrc +++ b/.bashrc @@ -41,7 +41,7 @@ alias cs='config status' alias clg="config log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(cyan)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all" alias bashrc='vim ~/.bashrc' -alias vimrc='vim ~/.vim/vimrc' +alias vimrc='vim $XDG_CONFIG_HOME/vim/vimrc' alias nvimrc='cd $XDG_CONFIG_HOME/nvim;nvim' alias i3config='vim $XDG_CONFIG_HOME/i3/config' alias startup='vim $XDG_CONFIG_HOME/i3/init' diff --git a/.config/vim/vimrc b/.config/vim/vimrc new file mode 100644 index 0000000..0984fc1 --- /dev/null +++ b/.config/vim/vimrc @@ -0,0 +1,102 @@ +set runtimepath^=$XDG_CONFIG_HOME/vim +set runtimepath+=$XDG_DATA_HOME/vim +set runtimepath+=$XDG_CONFIG_HOME/vim/after + +set packpath^=$XDG_DATA_HOME/vim,$XDG_CONFIG_HOME/vim +set packpath+=$XDG_CONFIG_HOME/vim/after,$XDG_DATA_HOME/vim/after + +let g:netrw_home = $XDG_DATA_HOME."/vim" +call mkdir($XDG_DATA_HOME."/vim/spell", 'p') +set viewdir=$XDG_DATA_HOME/vim/view | call mkdir(&viewdir, 'p') + +set viminfofile=$XDG_CACHE_HOME/vim/viminfo +set backupdir=$XDG_CACHE_HOME/vim/backup | call mkdir(&backupdir, 'p') +set directory=$XDG_CACHE_HOME/vim/swap | call mkdir(&directory, 'p') +set undodir=$XDG_CACHE_HOME/vim/undo | call mkdir(&undodir, 'p') +set undofile + +call plug#begin('~/.config/vim/plugged') + Plug 'romgrk/doom-one.vim' + Plug 'tpope/vim-surround' + Plug 'tpope/vim-commentary' +call plug#end() + +filetype indent plugin on +syntax enable +set mouse=a +set termguicolors +set nocompatible +set hidden +set wildmenu +set wildignorecase +set fileignorecase +set showcmd +set hlsearch +set incsearch +set ignorecase +set smartcase +set backspace=indent,eol,start +set autoindent +set ruler +set confirm +set visualbell +set number relativenumber +set notimeout ttimeout ttimeoutlen=200 +set pastetoggle= +set shiftwidth=4 +set softtabstop=4 +set expandtab +set noswapfile +set nowrap +set background=dark +set cursorline +set splitright +set splitbelow + +map Y y$ +nnoremap :nohl +nnoremap n nzzzv +nnoremap N Nzzzv +" inoremap kj +tnoremap kj + +inoremap , ,u +inoremap . .u +inoremap [ [u +inoremap ! !u +inoremap ? ?u + +vnoremap J :m '>+1gv=gv +vnoremap K :m '<-2gv=gv + +let mapleader=" " +nnoremap h :wincmd h +nnoremap j :wincmd j +nnoremap k :wincmd k +nnoremap l :wincmd l +nnoremap :wincmd h +nnoremap :wincmd j +nnoremap :wincmd k +nnoremap :wincmd l + +let &t_8f = "\[38:2:%lu:%lu:%lum" +let &t_8b = "\[48:2:%lu:%lu:%lum" +colorscheme doom-one +highlight CursorLineNr cterm=bold ctermbg=Black ctermfg=Blue + +set runtimepath^=$XDG_CONFIG_HOME/vim +set runtimepath+=$XDG_DATA_HOME/vim +set runtimepath+=$XDG_CONFIG_HOME/vim/after + +set packpath^=$XDG_DATA_HOME/vim,$XDG_CONFIG_HOME/vim +set packpath+=$XDG_CONFIG_HOME/vim/after,$XDG_DATA_HOME/vim/after + +let g:netrw_home = $XDG_DATA_HOME."/vim" +call mkdir($XDG_DATA_HOME."/vim/spell", 'p') +set viewdir=$XDG_DATA_HOME/vim/view | call mkdir(&viewdir, 'p') + +set viminfofile=$XDG_CACHE_HOME/vim/viminfo +set backupdir=$XDG_CACHE_HOME/vim/backup | call mkdir(&backupdir, 'p') +set directory=$XDG_CACHE_HOME/vim/swap | call mkdir(&directory, 'p') +set undodir=$XDG_CACHE_HOME/vim/undo | call mkdir(&undodir, 'p') +set undofile diff --git a/.vim/vimrc b/.vim/vimrc deleted file mode 100644 index f174b07..0000000 --- a/.vim/vimrc +++ /dev/null @@ -1,87 +0,0 @@ -call plug#begin('~/.vim/plugged') - Plug 'romgrk/doom-one.vim' - " Plug 'tpope/vim-fugitive' - Plug 'tpope/vim-surround' - " Plug 'tpope/vim-repeat' - Plug 'tpope/vim-commentary' -call plug#end() - -filetype indent plugin on -syntax enable -set mouse=a -set termguicolors -set nocompatible -set hidden -set wildmenu -set wildignorecase -set fileignorecase -set showcmd -set hlsearch -set incsearch -set ignorecase -set smartcase -set backspace=indent,eol,start -set autoindent -set ruler -set confirm -set visualbell -set number relativenumber -set notimeout ttimeout ttimeoutlen=200 -set pastetoggle= -set shiftwidth=4 -set softtabstop=4 -set expandtab -set noswapfile -set nowrap -set background=dark -set cursorline -set splitright -set splitbelow - -map Y y$ -nnoremap :nohl -nnoremap n nzzzv -nnoremap N Nzzzv -" inoremap kj -tnoremap kj - -inoremap , ,u -inoremap . .u -inoremap [ [u -inoremap ! !u -inoremap ? ?u - -vnoremap J :m '>+1gv=gv -vnoremap K :m '<-2gv=gv - -let mapleader=" " -nnoremap h :wincmd h -nnoremap j :wincmd j -nnoremap k :wincmd k -nnoremap l :wincmd l -nnoremap :wincmd h -nnoremap :wincmd j -nnoremap :wincmd k -nnoremap :wincmd l - -let &t_8f = "\[38:2:%lu:%lu:%lum" -let &t_8b = "\[48:2:%lu:%lu:%lum" -colorscheme doom-one -highlight CursorLineNr cterm=bold ctermbg=Black ctermfg=Blue - -set runtimepath^=$XDG_CONFIG_HOME/vim -set runtimepath+=$XDG_DATA_HOME/vim -set runtimepath+=$XDG_CONFIG_HOME/vim/after - -set packpath^=$XDG_DATA_HOME/vim,$XDG_CONFIG_HOME/vim -set packpath+=$XDG_CONFIG_HOME/vim/after,$XDG_DATA_HOME/vim/after - -let g:netrw_home = $XDG_DATA_HOME."/vim" -call mkdir($XDG_DATA_HOME."/vim/spell", 'p') -set viewdir=$XDG_DATA_HOME/vim/view | call mkdir(&viewdir, 'p') - -set viminfofile=$XDG_CACHE_HOME/vim/viminfo -set backupdir=$XDG_CACHE_HOME/vim/backup | call mkdir(&backupdir, 'p') -set directory=$XDG_CACHE_HOME/vim/swap | call mkdir(&directory, 'p') -set undodir=$XDG_CACHE_HOME/vim/undo | call mkdir(&undodir, 'p') -set undofile -- cgit v1.2.3-70-g09d2