From b4fb62514ee66e9678d2ad8f4f3c28a4e482388f Mon Sep 17 00:00:00 2001 From: Solomon Laing Date: Mon, 16 May 2022 20:51:18 +0930 Subject: [PATCH] modified init.vim somewhat --- .config/nvim/init.vim | 27 +-------------------------- .zshrc | 8 +++++++- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 971a9e2..ad3fd62 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -1,4 +1,4 @@ -let mapleader ="," +let mapleader ="/" if ! filereadable(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim"')) echo "Downloading junegunn/vim-plug to manage plugins..." @@ -12,7 +12,6 @@ Plug 'tpope/vim-surround' Plug 'preservim/nerdtree' Plug 'junegunn/goyo.vim' Plug 'jreybert/vimagit' -Plug 'lukesmithxyz/vimling' Plug 'vimwiki/vimwiki' Plug 'vim-airline/vim-airline' Plug 'tpope/vim-commentary' @@ -59,13 +58,6 @@ set noshowcmd let NERDTreeBookmarksFile = '~/.vim' . '/NERDTreeBookmarks' endif -" vimling: - nm d :call ToggleDeadKeys() - imap d :call ToggleDeadKeys()a - nm i :call ToggleIPA() - imap i :call ToggleIPA()a - nm q :call ToggleProse() - " Shortcutting split navigation, saving a keypress: map h map j @@ -78,10 +70,6 @@ set noshowcmd " Check file in shellcheck: map s :!clear && shellcheck -x % -" Open my bibliography file in split - map b :vsp$BIB - map r :vsp$REFER - " Replace all is aliased to S. nnoremap S :%s//g @@ -105,12 +93,6 @@ set noshowcmd " Save file as sudo on files that require root permission cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' edit! -" Enable Goyo by default for mutt writing - autocmd BufRead,BufNewFile /tmp/neomutt* let g:goyo_width=80 - autocmd BufRead,BufNewFile /tmp/neomutt* :Goyo | set bg=light - autocmd BufRead,BufNewFile /tmp/neomutt* map ZZ :Goyo\|x! - autocmd BufRead,BufNewFile /tmp/neomutt* map ZQ :Goyo\|q! - " Automatically deletes all trailing whitespace and newlines at end of file on save. & reset cursor position autocmd BufWritePre * let currPos = getpos(".") autocmd BufWritePre * %s/\s\+$//e @@ -123,8 +105,6 @@ set noshowcmd " Run xrdb whenever Xdefaults or Xresources are updated. autocmd BufRead,BufNewFile Xresources,Xdefaults,xresources,xdefaults set filetype=xdefaults autocmd BufWritePost Xresources,Xdefaults,xresources,xdefaults !xrdb % -" Recompile dwmblocks on config edit. - autocmd BufWritePost ~/.local/src/dwmblocks/config.h !cd ~/.local/src/dwmblocks/; sudo make install && { killall -q dwmblocks;setsid -f dwmblocks } " Turns off highlighting on the bits of code that are changed, so the line that is changed is highlighted but the actual text that has changed stands out on the line and is readable. if &diff @@ -149,8 +129,3 @@ function! ToggleHiddenAll() endif endfunction nnoremap h :call ToggleHiddenAll() -" Load command shortcuts generated from bm-dirs and bm-files via shortcuts script. -" Here leader is ";". -" So ":vs ;cfz" will expand into ":vs /home//.config/zsh/.zshrc" -" if typed fast without the timeout. -" source ~/.config/nvim/shortcuts.vim diff --git a/.zshrc b/.zshrc index 8dd3489..fa5687b 100644 --- a/.zshrc +++ b/.zshrc @@ -113,6 +113,7 @@ alias ls='ls -la --color=auto' alias tmn='tmux new' alias tma='tmux attach' alias lf='lfub' +alias v='nvim' path+=('/home/solomon/.local/bin') @@ -207,7 +208,12 @@ ZSH_HIGHLIGHT_STYLES[arg0]='fg=#F8F8F2' ZSH_HIGHLIGHT_STYLES[default]='fg=#F8F8F2' ZSH_HIGHLIGHT_STYLES[cursor]='standout' -HOST=$(hostname) +if [ -f /etc/hostname ]; then + HOST=$(cat /etc/hostname) +else + HOST=$(hostname) +fi + if [ "$HOST" = "holocene" ] ; then source /usr/share/zsh/site-functions/zsh-syntax-highlighting.zsh else