From 7a73d436072a322498f3b668a29e8731b0255f35 Mon Sep 17 00:00:00 2001 From: Kumar Damani Date: Mon, 9 Mar 2020 23:40:27 -0400 Subject: added nvim --- .gitignore | 1 + Scripts/.config/Scripts/screen.sh | 3 +- music/.config/mpd/state | 6 +- nvim/.config/nvim/init.vim | 138 ++++++++++++++++++++++++++++++++++++++ profile/.bash_profile | 2 +- profile/.profile | 3 +- ranger/.config/ranger/rc.conf | 1 + st/st/README.md | 8 ++- st/st/config.h | 30 +++++---- st/st/st | Bin 115616 -> 115704 bytes zsh/.zshrc | 82 +++++++++++++++++----- 11 files changed, 237 insertions(+), 37 deletions(-) create mode 100644 nvim/.config/nvim/init.vim diff --git a/.gitignore b/.gitignore index d3d8eed..4e50d25 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ ranger/.config/ranger/bookmarks dwm/dwm/.git *.o vim/.vim/plugged/ +nvim/.config/nvim/plugged/ tmux/.config/tmux/resurrect/*.txt diff --git a/Scripts/.config/Scripts/screen.sh b/Scripts/.config/Scripts/screen.sh index 85edb46..1bfcd53 100755 --- a/Scripts/.config/Scripts/screen.sh +++ b/Scripts/.config/Scripts/screen.sh @@ -9,7 +9,8 @@ d() { if [[ $(xrandr -q | grep VGA-1\ con) ]] then param $1 else echo "No VGA input detected." fi ;} -dual() { xrandr --output LVDS-1 --primary --auto --output VGA-1 --auto --left-of LVDS-1 ;} +#dual() { xrandr --output LVDS-1 --primary --auto --output VGA-1 --auto --left-of LVDS-1 ;} +dual() { xrandr --output LVDS-1 --primary --auto --output VGA-1 --auto --right-of LVDS-1 ;} laptop() { xrandr --output LVDS-1 --primary --auto --output VGA-1 --off ;} vga() { xrandr --output VGA-1 --auto --output LVDS-1 --off ;} #mirror() { xrandr --addmode VGA1 $lapres && xrandr --output LVDS1 --mode $lapres --output VGA1 --mode $lapres ;} diff --git a/music/.config/mpd/state b/music/.config/mpd/state index 98a3446..9088395 100644 --- a/music/.config/mpd/state +++ b/music/.config/mpd/state @@ -1,7 +1,9 @@ sw_volume: 100 audio_device_state:1:mpd alsamixer-output audio_device_state:1:toggle_visualizer -state: stop +state: pause +current: 1 +time: 5.281000 random: 0 repeat: 0 single: 0 @@ -10,4 +12,6 @@ crossfade: 0 mixrampdb: 0.000000 mixrampdelay: -1.000000 playlist_begin +0:newSchool/A$AP ROCKY - F_kin' Problems ft. Drake, 2 Chainz, Kendrick Lamar-liZm1im2erU.mp3 +1:Balmorhea/Balmorhea - March 4, 1831.mp3 playlist_end diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim new file mode 100644 index 0000000..896d282 --- /dev/null +++ b/nvim/.config/nvim/init.vim @@ -0,0 +1,138 @@ +call plug#begin() + Plug 'ncm2/ncm2' + Plug 'roxma/nvim-yarp' + Plug 'ncm2/ncm2-bufword' + Plug 'ncm2/ncm2-path' + Plug 'ncm2/ncm2-ultisnips' + Plug 'SirVer/ultisnips' + Plug 'honza/vim-snippets' + Plug '/usr/bin/fzf' + Plug 'junegunn/fzf.vim' + Plug 'itchyny/lightline.vim' + Plug 'airblade/vim-gitgutter' + Plug 'raimondi/delimitmate' + Plug 'pearofducks/ansible-vim' + Plug 'nathanielc/vim-tickscript' +call plug#end() + +" Some basics: + filetype plugin on + syntax on + colorscheme koehler + set noswapfile + set encoding=utf-8 + set number + set relativenumber + set cursorline + let mapleader = "," + set pastetoggle=v + nmap , :w + +" Tab settings + set tabstop=4 + set shiftwidth=4 + set expandtab + autocmd Filetype css setlocal tabstop=2 + autocmd FileType yml setlocal ai ts=2 sw=2 et + autocmd FileType yaml setlocal ai ts=2 sw=2 et + autocmd FileType jinja setlocal ai ts=2 sw=2 et + autocmd FileType python setlocal ai ts=4 sw=4 et + +" C-T for new tab buffer + nnoremap :tabnew + +" For normal mode when in terminals (in X I have caps mapped to esc, this replaces it when I don't have X) + inoremap jk + +"Shortcutting split navigation, saving a keypress: + map h + map j + map k + map l + + +" Saving view folds + au BufWinLeave * mkview + +" Spell-check set to F6: + map :setlocal spell! spelllang=en_ca + +" Enable autocompletion: + set wildmode=longest,list,full + set wildmenu + +" Automatically deletes all tralling whitespace on save. + autocmd BufWritePre * %s/\s\+$//e + +"Replace all is aliased to S. Visual mode shortcut doesn't work yet for some +"reason... + nnoremap S :%s//g + vnoremap S noop + vnoremap S :s//g + + vnoremap K xkP`[V`] + vnoremap J xp`[V`] + vnoremap L >gv + vnoremap H + map gp :bp + map gd :bd + +" toggle line chars view + set listchars=tab:→\ ,eol:↲,nbsp:␣,trail:•,extends:⟩,precedes:⟨ + noremap l :set list! + set list + +" Ansible settings + au BufRead,BufNewFile */playbooks/*.yaml set filetype=yaml.ansible + au BufRead,BufNewFile */tasks/*.yaml set filetype=yaml.ansible + au BufRead,BufNewFile */group_vars/*.yaml set filetype=yaml.ansible + au BufRead,BufNewFile *.j2 set filetype=yaml.ansible + let g:ansible_attribute_highlight = "ad" + let g:ansible_name_highlight = 'd' + let g:ansible_extra_keywords_highlight = 1 + let g:ansible_normal_keywords_highlight = 'Constant' + let g:ansible_with_keywords_highlight = 'Constant' + +" Tick + let g:tick_fmt_autosave = 0 + + +" Git-gutter + set updatetime=100 + +" lightline config + set noshowmode + set laststatus=2 + +" colorscheme nord + let g:lightline = { + \ 'active': { + \ 'left': [['mode', 'paste' ], ['readonly', 'filename', 'modified']], + \ 'right': [['lineinfo'], ['percent'], ['fileformat', 'fileencoding']] + \ }, + \ 'colorscheme': 'srcery_drk' + \ } + +" fzf hotkey + function! s:find_git_root() + return system('git rev-parse --show-toplevel 2> /dev/null')[:-2] + endfunction + command! ProjectFiles execute 'Files' s:find_git_root() + + map g :ProjectFiles + map f :Files + + +" IMPORTANT: :help Ncm2PopupOpen for more information + set completeopt=noinsert,menuone,noselect + +" enable ncm2 for all buffers + autocmd BufEnter * call ncm2#enable_for_buffer() + + let g:UltiSnipsJumpForwardTrigger = "" + let g:UltiSnipsJumpBackwardTrigger = "" + let g:UltiSnipsRemoveSelectModeMappings = 0 diff --git a/profile/.bash_profile b/profile/.bash_profile index 863566c..8d4eb4c 100644 --- a/profile/.bash_profile +++ b/profile/.bash_profile @@ -13,7 +13,7 @@ export PATH=$PATH:$HOME/.config/Scripts export XDG_CONFIG_HOME="$HOME/.config" export BROWSER="firefox" -export EDITOR="vim" +export EDITOR="nvim" export TERMINAL="st" export READER="zathura" export QT_QPA_PLATFORMTHEME="qt5ct" diff --git a/profile/.profile b/profile/.profile index 0c5ac5f..e529e31 100644 --- a/profile/.profile +++ b/profile/.profile @@ -1,7 +1,8 @@ export PATH=$PATH:$HOME/.config/Scripts export XDG_CONFIG_HOME="$HOME/.config" +#export BROWSER="firefox" export BROWSER="vivaldi-stable" -export EDITOR="vim" +export EDITOR="nvim" export TERMINAL="st" export READER="zathura" export QT_QPA_PLATFORMTHEME="qt5ct" diff --git a/ranger/.config/ranger/rc.conf b/ranger/.config/ranger/rc.conf index 177fab4..b42dd4f 100644 --- a/ranger/.config/ranger/rc.conf +++ b/ranger/.config/ranger/rc.conf @@ -52,6 +52,7 @@ set preview_max_size 0 set show_selection_in_titlebar true set idle_delay 2000 set metadata_deep_search false +set w3m_delay 0.1 ###ALIASES### diff --git a/st/st/README.md b/st/st/README.md index c7a1d9b..466c366 100644 --- a/st/st/README.md +++ b/st/st/README.md @@ -20,7 +20,7 @@ The [suckless terminal (st)](https://st.suckless.org/) with some additional feat + Compatibility with `Xresources` and `pywal` for dynamic colors. The `Xdefaults` file shows a usage example. + Default [gruvbox](https://github.com/morhetz/gruvbox) colors otherwise. + Transparency/alpha, which is also adjustable from your `Xresources`. -+ Default font is system "mono" at 16pt, meaning the font will match your system font. ++ Default font is system "mono" at 14pt, meaning the font will match your system font. ## Other st patches @@ -70,6 +70,12 @@ To be clear about the color settings: Note that when you run `wal`, it will negate the transparency of existing windows, but new windows will continue with the previously defined transparency. +## Notes on Emojis and Special Characters + +If st crashes when viewing emojis, install [libxft-bgra](https://aur.archlinux.org/packages/libxft-bgra/) from the AUR. + +Note that some special characters may appear truncated if too wide. You might want to manually set your prefered emoji/special character font to a lower size in the `config.h` file to avoid this. By default, JoyPixels is used at a smaller size than the usual text. + ## Contact - Luke Smith diff --git a/st/st/config.h b/st/st/config.h index 22e9d21..6ee8ea9 100644 --- a/st/st/config.h +++ b/st/st/config.h @@ -5,8 +5,8 @@ * * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html */ -static char *font = "mono:pixelsize=16:antialias=true:autohint=true"; -static char *font2[] = { "Inconsolata for Powerline:pixelsize=16:antialias=true:autohint=true" }; +static char *font = "mono:pixelsize=14:antialias=true:autohint=true"; +static char *font2[] = { "JoyPixels:pixelsize=10:antialias=true:autohint=true" }; static int borderpx = 2; /* @@ -106,9 +106,10 @@ static const char *colorname[] = { "#ebdbb2", [255] = 0, /* more colors can be added after 255 to use with DefaultXX */ - "#282828", /* 256 -> bg */ - "#ebdbb2", /* 257 -> fg */ - "#add8e6", /* 258 -> cursor */ + "#add8e6", /* 256 -> cursor */ + "#555555", /* 257 -> rev cursor*/ + "#282828", /* 258 -> bg */ + "#ebdbb2", /* 259 -> fg */ }; @@ -116,10 +117,10 @@ static const char *colorname[] = { * Default colors (colorname index) * foreground, background, cursor, reverse cursor */ -unsigned int defaultfg = 257; -unsigned int defaultbg = 256; -static unsigned int defaultcs = 258; -static unsigned int defaultrcs = 0; +unsigned int defaultfg = 259; +unsigned int defaultbg = 258; +static unsigned int defaultcs = 256; +static unsigned int defaultrcs = 257; /* * Default shape of cursor @@ -172,9 +173,9 @@ ResourcePref resources[] = { { "color13", STRING, &colorname[13] }, { "color14", STRING, &colorname[14] }, { "color15", STRING, &colorname[15] }, - { "background", STRING, &colorname[256] }, - { "foreground", STRING, &colorname[257] }, - { "cursorColor", STRING, &colorname[258] }, + { "background", STRING, &colorname[258] }, + { "foreground", STRING, &colorname[259] }, + { "cursorColor", STRING, &colorname[256] }, { "termname", STRING, &termname }, { "shell", STRING, &shell }, { "xfps", INTEGER, &xfps }, @@ -213,11 +214,11 @@ MouseKey mkeys[] = { }; static char *openurlcmd[] = { "/bin/sh", "-c", - "sed 's/.*│//g' | tr -d '\n' | grep -aEo '(((http|https)://|www\\.)[a-zA-Z0-9.]*[:]?[a-zA-Z0-9./&%?#=_-]*)|((magnet:\\?xt=urn:btih:)[a-zA-Z0-9]*)'| uniq | sed 's/^www./http:\\/\\/www\\./g' | dmenu -i -p 'Follow which url?' -l 10 | xargs -r xdg-open", + "sed 's/.*│//g' | tr -d '\n' | grep -aEo '(((http|https)://|www\\.)[a-zA-Z0-9.]*[:]?[a-zA-Z0-9./&%?$#=_-]*)|((magnet:\\?xt=urn:btih:)[a-zA-Z0-9]*)'| uniq | sed 's/^www./http:\\/\\/www\\./g' | dmenu -i -p 'Follow which url?' -l 10 | xargs -r xdg-open", "externalpipe", NULL }; static char *copyurlcmd[] = { "/bin/sh", "-c", - "sed 's/.*│//g' | tr -d '\n' | grep -aEo '(((http|https)://|www\\.)[a-zA-Z0-9.]*[:]?[a-zA-Z0-9./&%?#=_-]*)|((magnet:\\?xt=urn:btih:)[a-zA-Z0-9]*)' | uniq | sed 's/^www./http:\\/\\/www\\./g' | dmenu -i -p 'Copy which url?' -l 10 | tr -d '\n' | xclip -selection clipboard", + "sed 's/.*│//g' | tr -d '\n' | grep -aEo '(((http|https)://|www\\.)[a-zA-Z0-9.]*[:]?[a-zA-Z0-9./&%?$#=_-]*)|((magnet:\\?xt=urn:btih:)[a-zA-Z0-9]*)' | uniq | sed 's/^www./http:\\/\\/www\\./g' | dmenu -i -p 'Copy which url?' -l 10 | tr -d '\n' | xclip -selection clipboard", "externalpipe", NULL }; static char *copyoutput[] = { "/bin/sh", "-c", "st-copyout", "externalpipe", NULL }; @@ -235,6 +236,7 @@ static Shortcut shortcuts[] = { { MODKEY, XK_c, clipcopy, {.i = 0} }, { MODKEY, XK_v, clippaste, {.i = 0} }, { MODKEY, XK_p, selpaste, {.i = 0} }, + { XK_ANY_MOD, Button2, selpaste, {.i = 0} }, { MODKEY, XK_Num_Lock, numlock, {.i = 0} }, { MODKEY, XK_Control_L, iso14755, {.i = 0} }, { ShiftMask, XK_Page_Up, kscrollup, {.i = -1} }, diff --git a/st/st/st b/st/st/st index bc94133..9f03e4e 100755 Binary files a/st/st/st and b/st/st/st differ diff --git a/zsh/.zshrc b/zsh/.zshrc index 28b95cf..46edd7c 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -62,7 +62,7 @@ ZSH_THEME="pygmalion" # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. -plugins=(git zsh-autosuggestions vi-mode) +plugins=(git zsh-autosuggestions vi-mode fzf) source $ZSH/oh-my-zsh.sh @@ -91,11 +91,55 @@ source $ZSH/oh-my-zsh.sh bindkey '^ ' autosuggest-accept -export KEYTIMEOUT=1 +# ENVIRONMENT VARS + +# nnn ENV Vars +export NNN_BMS='h:~;d:~/Documents;D:~/Downloads;w:~/Downloads/wallpapers' +export NNN_USE_EDITOR=1 +export NNN_COLORS='2136' +export LC_COLLATE="C" +NNN_PLUGS="x:_chmod +x $nnn;\ + g:_git log;\ + o:fzopen;\ + f:fzcd" +#export NNN_PLUG=`echo $NNN_PLUGS | sed -e 's/;\s*/;/g'` +export NNN_PLUG="$(echo "$NNN_PLUGS" | sed -e 's/;\s*/;/g')" + + +n () +{ + # Block nesting of nnn in subshells + if [ -n $NNNLVL ] && [ "${NNNLVL:-0}" -ge 1 ]; then + echo "nnn is already running" + return + fi + + # The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set) + # To cd on quit only on ^G, remove the "export" as in: + # NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd" + # NOTE: NNN_TMPFILE is fixed, should not be modified + export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd" + + # Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn + # stty start undef + # stty stop undef + # stty lwrap undef + # stty lnext undef + + nnn "$@" + + if [ -f "$NNN_TMPFILE" ]; then + . "$NNN_TMPFILE" + rm -f "$NNN_TMPFILE" > /dev/null + fi +} + +[ -n "$NNNLVL" ] && PS1="N$NNNLVL $PS1" + # Example aliases -alias v="vim" +alias v="nvim" #alias r="vifm ." alias r="ranger" alias ls='ls++' @@ -123,20 +167,22 @@ alias D="cd ~/Downloads && ls -a" alias s="cd ~/.config/Scripts && ls -a" alias c="cd ~/Dropbox/winter2019 && ls -a" alias w="cd ~/Downloads/wallpapers && ls -a" -alias cfb="vim ~/.bashrc" -alias cfv="vim ~/.config/Scripts/vimrc" -alias cfr="vim ~/.config/vifm/vifmrc" -alias cfR="vim ~/.config/ranger/rc.conf" -alias cfi="vim ~/.config/i3/config" -alias cfm="vim ~/.config/mutt/muttrc" -alias cff="vim ~/.config/Scripts/folders" -alias cfc="vim ~/.config/Scripts/configs" -alias cfT="vim ~/.config/Scripts/tmux.conf" -alias cfa="vim ~/.config/mutt/aliases" -alias cfp="vim ~/.config/polybar/mybar" -alias cfs="vim ~/.config/sxhkd/sxhkdrc" -alias cfsb="vim ~/.config/sxhkd/sxhkdrc_bspwm" -alias cfB="vim ~/.config/bspwm/bspwmrc" -alias cfz="vim ~/.zshrc" +alias cfb="nvim ~/.bashrc" +alias cfv="nvim ~/.config/nvim/init.vim" +alias cfr="nvim ~/.config/vifm/vifmrc" +alias cfR="nvim ~/.config/ranger/rc.conf" +alias cfi="nvim ~/.config/i3/config" +alias cfm="nvim ~/.config/mutt/muttrc" +alias cff="nvim ~/.config/Scripts/folders" +alias cfc="nvim ~/.config/Scripts/configs" +alias cfT="nvim ~/.config/Scripts/tmux.conf" +alias cfa="nvim ~/.config/mutt/aliases" +alias cfp="nvim ~/.config/polybar/mybar" +alias cfs="nvim ~/.config/sxhkd/sxhkdrc" +alias cfsb="nvim ~/.config/sxhkd/sxhkdrc_bspwm" +alias cfB="nvim ~/.config/bspwm/bspwmrc" +alias cfz="nvim ~/.zshrc" alias auto="ssh kdamani@10.65.17.184" + +#[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh -- cgit v1.2.3