summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimmy Keller <tjk@tjkeller.xyz>2022-04-17 12:02:36 -0500
committerTimmy Keller <tjk@tjkeller.xyz>2022-04-17 12:02:36 -0500
commitc878742ad78a014fef93c520abd1c1d846f2c0d9 (patch)
treea960c960fe4d15a2526b56206605b4abafaaa505
parentd228b792e7aebd573470b4d10c9cbf9deb404719 (diff)
parenta6831bb06715245a580f409bb9cc2e53cf63ee94 (diff)
downloaddotconfig-c878742ad78a014fef93c520abd1c1d846f2c0d9.tar.xz
dotconfig-c878742ad78a014fef93c520abd1c1d846f2c0d9.zip
Merge branch 'master' of git.tjkeller.xyz:/var/www/git/dotconfig
-rwxr-xr-xnvim/init.vim.old121
-rwxr-xr-xzsh/zscripts/colors.voidx250.zsh7
-rwxr-xr-xzsh/zshrc2
3 files changed, 129 insertions, 1 deletions
diff --git a/nvim/init.vim.old b/nvim/init.vim.old
new file mode 100755
index 0000000..bc23e31
--- /dev/null
+++ b/nvim/init.vim.old
@@ -0,0 +1,121 @@
+" Manage plugins using vim-plug
+if ! filereadable(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim"'))
+ echo "Downloading junegunn/vim-plug to manage plugins..."
+ silent !mkdir -p ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/
+ silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim
+ autocmd VimEnter * PlugInstall
+endif
+
+call plug#begin(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/plugged"'))
+Plug 'jiangmiao/auto-pairs'
+Plug 'junegunn/goyo.vim'
+Plug 'alvan/vim-closetag'
+Plug 'ap/vim-css-color'
+Plug 'vimwiki/vimwiki'
+call plug#end()
+
+" Basic options
+set autochdir " Always change directory to current file
+set autoindent " Keeps indentation on new lines
+set hlsearch " Highlight search hits
+set ignorecase " Case-insensitive search...
+set linebreak " Word wrap
+set mouse=a " Because sometimes it's just easier to use the mouse
+set number relativenumber " Enable relative line numbers
+set smartcase " ...Unless the search term is capital
+set splitbelow splitright " Open splits on bottom/right instead of top/left
+set termguicolors " Enable GUI colors for the terminal to get truecolor
+set wildmode=longest,list,full " Enable file auto-complete
+syntax on " Enable syntax highlighting
+
+" VimWiki options
+let g:vimwiki_list = [{'path': '~/docs/school/docs/wiki/', 'path_html': '~/docs/school/docs/wiki/site/'}]
+
+" Keybindings
+ " Set leader-key to comma
+let mapleader =","
+ " Invoke goyo with comma-m
+nmap <leader>m :Goyo<CR>
+ " Invoke spellcheck mode with comma-o
+nmap <leader>l :setlocal spell! spelllang=en_us<CR>
+ " Invoke spellcheck mode with comma-o
+nmap <leader>c :set cursorcolumn!<CR>
+ " Send cursor to top or bottom currently visible line with ctrl-jk
+" map <C-j> :call cursor(line('w$'),col('.'))<CR>
+" map <C-k> :call cursor(line('w0'),col('.'))<CR>
+ " Navigate faster than hjkl with ctrl-hjlk
+nmap <C-h> 0
+nmap <C-j> <C-d>
+nmap <C-k> <C-u>
+nmap <C-l> $
+ " Faster split navigation (alt-hjlk, as opposed to ctrl-w + hjlk)
+"map <A-h> <C-w>h
+"map <A-j> <C-w>j
+"map <A-k> <C-w>k
+"map <A-l> <C-w>l
+ " Streamlined tab navigation with chromium inspired keybindings
+nmap <TAB> gt
+nmap <S-TAB> gT
+nmap <C-T> :tabnew<CR>
+ " Copy, paste, and cut with standard bindings
+map <C-c> "+y
+"map <C-v> "+gp
+map <C-x> "+x
+
+" Colorscheme for root and normal users (since vimrc is just symlinked to the root user's home)
+if ($USER) == 'root'
+ colorscheme zellner
+else
+ if empty($DISPLAY)
+ colorscheme default
+ else
+ set bg=dark
+ let g:gruvbox_contrast_dark = 'hard'
+ colorscheme gruvbox-timmy
+ endif
+endif
+
+" Behaviors exclusive to either the tty or a terminal emulator in a graphical environment
+if empty($DISPLAY)
+ " Clear the tty screen after exiting vim
+ "autocmd QuitPre * :!clear
+else
+ set cursorline " Highlight current line
+ " Change the terminal emulator's window title and class name to vim
+ autocmd BufEnter * :set title
+ autocmd VimEnter * :silent exec "!/home/timmy/scripts/st/settitle Vim"
+ autocmd VimLeave * :silent exec "!/home/timmy/scripts/st/settitle st"
+ let &titleold="st"
+endif
+
+" Set the cursor on a per-mode basis (Not needed in NVIM)
+"let &t_SI.="\<Esc>[6 q" " Insert mode
+"let &t_SR.="\<Esc>[4 q" " Replace mode
+"let &t_EI.="\<Esc>[2 q" " Normal mode
+"let &t_ti.="\<Esc>[2 q" " Cursor on startup
+
+" Automatically deletes all trailing whitespace on save
+function DelWS()
+ :let ccc=col('.') " Set current cursor column
+ :let ccl=line('.') " Set current cursor line
+ :%s/\s\+$//e " Find and remove trailing whitespace on each line
+ :call cursor(ccl,ccc) " Move cursor to previous position
+endfunction
+autocmd BufWritePre * call DelWS()
+
+" Disables automatic commenting on newline:
+ autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
+" Perform dot commands over visual blocks:
+ vnoremap . :normal .<CR>
+" Save file as sudo on files that require root permission
+ cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit!
+" LaTeX syntax highlighting
+ autocmd BufRead,BufNewFile *.tex set filetype=tex
+
+" Plugin options
+ " closetag
+let g:closetag_filenames = '*.html,*.xhtml,*.phtml'
+
+" Get rid of the pointless .viminfo files that clutter the home directory
+let skip_defaults_vim=1
+set viminfo=""
diff --git a/zsh/zscripts/colors.voidx250.zsh b/zsh/zscripts/colors.voidx250.zsh
new file mode 100755
index 0000000..cf710f3
--- /dev/null
+++ b/zsh/zscripts/colors.voidx250.zsh
@@ -0,0 +1,7 @@
+if [ -n "$DISPLAY" ]; then
+ declare col{br,at}=green
+ declare col{name,host}=76
+ coldir=40
+else
+ declare col{br,name,at,host,dir}=green
+fi
diff --git a/zsh/zshrc b/zsh/zshrc
index 8272e56..5200f3d 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -21,7 +21,7 @@ setopt EXTENDED_HISTORY # Save superfluous info with command to reduce disk wri
# Other settings
setopt autocd # 'cd' is implied
-"/home/timmy/.local/opt/shell-color-scripts/colorscripts/$(ls /home/timmy/.local/opt/shell-color-scripts/colorscripts | shuf -n1)"
+"/home/timmy/.local/opt/shell-color-scripts/colorscripts/$(ls /home/timmy/.local/opt/shell-color-scripts/colorscripts 2>/dev/null | shuf -n1)" 2>/dev/null
# Load zsh plugins; should be last
for plugin in ${=ZPLUGINS}; do source "$plugin"; done