From 6b3a0efc28ea2d4c0eeb0ca1ced1e58e412e94f8 Mon Sep 17 00:00:00 2001 From: ackman678 Date: Fri, 28 Feb 2020 13:50:20 -0800 Subject: [PATCH] sway the things - add screenshot shortcut to sway config - updated ctags, tagbar for vim. - Markdown and BibTex now included, rm ctags config file - and updated vimrc with altered ctags linkers --- .bashrc | 10 +++ .config/sway/config | 16 ++++- .ctags.d/config.ctags | 23 ------- .vimrc | 141 +++++++++++++++++++++++++++++++++--------- 4 files changed, 138 insertions(+), 52 deletions(-) delete mode 100644 .ctags.d/config.ctags diff --git a/.bashrc b/.bashrc index ba06ad0..4d652dd 100644 --- a/.bashrc +++ b/.bashrc @@ -14,6 +14,16 @@ RESET="\[$(tput sgr0)\]" #PS1="${BLUE}\u@\h \W>${RESET} " PS1="${BLUE}\W>${RESET} " +man() { + LESS_TERMCAP_md=$'\e[01;31m' \ + LESS_TERMCAP_me=$'\e[0m' \ + LESS_TERMCAP_se=$'\e[0m' \ + LESS_TERMCAP_so=$'\e[01;44;33m' \ + LESS_TERMCAP_ue=$'\e[0m' \ + LESS_TERMCAP_us=$'\e[01;32m' \ + command man "$@" +} + alias ls='ls --color=auto' alias l='ls' alias la='ls -A' diff --git a/.config/sway/config b/.config/sway/config index 487f5d5..9c15949 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -9,7 +9,11 @@ # # Please see https://i3wm.org/docs/userguide.html for a complete reference! +# set modifier keys: +# Mod4=Apple Command|Windows key set $mod Mod4 +# Mod1=Alt|option key +set $alt Mod1 # Your preferred terminal emulator set $term urxvt @@ -21,6 +25,8 @@ set $menu dmenu_path | dmenu | xargs swaymsg exec -- bindsym --release $mod+z exec 'fn=$(date "+%Y-%m-%d-%H%M%S").png; grim -g "$(slurp)" $fn; ~/bin/mv2figs.sh $fn' # bindsym --release $mod+z exec scrot '%Y-%m-%d_%H%M%S_$wx$h.png' -e '~/bin/mv2figs.sh $f' +bindsym --release $alt+z exec 'fn=$(date "+%Y-%m-%d-%H%M%S").png; sleep 3; grim $fn; ~/bin/mv2figs.sh $fn' + bindsym $mod+Shift+z exec "date --iso-8601='seconds' | tr -d '\n' | xclip -selection clipboard" #check out wl-clipboard for wayland xclip solution https://github.com/bugaevc/wl-clipboard @@ -183,7 +189,7 @@ bindsym $mod+Shift+r restart # Exit sway (logs you out of your Wayland session) bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit' -# resize window (you can also use the mouse for that) +# resize windowfigures/2020-02-25-021616.png" (you can also use the mouse for that) mode "resize" { # These bindings trigger as soon as you enter the resize mode @@ -289,6 +295,14 @@ bindsym $mod+Shift+b bar mode toggle #client.placeholder $base00 $base00 $base05 $base00 $base00 #client.background $base07 +# disable system tray +# bar { + # tray_output none +# } + +# focus windowns using only keyboard +# focus_follows_mouse no + #Can use the following with custom workspace save files to reload layouts #exec --no-startup-id "i3-msg 'workspace 1; append_layout ~/.config/i3/workspace-1.json'" diff --git a/.ctags.d/config.ctags b/.ctags.d/config.ctags deleted file mode 100644 index e8a0b07..0000000 --- a/.ctags.d/config.ctags +++ /dev/null @@ -1,23 +0,0 @@ ---langdef=markdown ---langmap=markdown:.md ---regex-markdown=/^#[ \t]+(.*)/\1/h,Heading_L1/ ---regex-markdown=/^##[ \t]+(.*)/\1/i,Heading_L2/ ---regex-markdown=/^###[ \t]+(.*)/\1/k,Heading_L3/ - ---langdef=bib ---langmap=bib:.bib ---regex-bib=/^@article\{([^,]*)/\1/a,article/i ---regex-bib=/^@book\{([^,]*)/\1/b,book/i ---regex-bib=/^@booklet\{([^,]*)/\1/L,booklet/i ---regex-bib=/^@conference\{([^,]*)/\1/c,conference/i ---regex-bib=/^@inbook\{([^,]*)/\1/B,inbook/i ---regex-bib=/^@incollection\{([^,]*)/\1/C,incollection/i ---regex-bib=/^@inproceedings\{([^,]*)/\1/P,inproceedings/i ---regex-bib=/^@manual\{([^,]*)/\1/m,manual/i ---regex-bib=/^@mastersthesis\{([^,]*)/\1/T,mastersthesis/i ---regex-bib=/^@misc\{([^,]*)/\1/M,misc/i ---regex-bib=/^@phdthesis\{([^,]*)/\1/t,phdthesis/i ---regex-bib=/^@proceedings\{([^,]*)/\1/p,proceedings/i ---regex-bib=/^@techreport\{([^,]*)/\1/r,techreport/i ---regex-bib=/^@unpublished\{([^,]*)/\1/u,unpublished/i - diff --git a/.vimrc b/.vimrc index 3ea3d28..53b5f74 100644 --- a/.vimrc +++ b/.vimrc @@ -58,14 +58,30 @@ Plug 'junegunn/limelight.vim' Plug 'scrooloose/nerdcommenter' Plug 'majutsushi/tagbar' " Plug 'tpope/vim-commentary' -" Plug 'tpope/surround' +Plug 'tpope/vim-surround' +" https://github.com/tpope/vim-surround +" cs, ds, yss to change, delete surroundings and operate on a line +" with a selection in visual mode use S + +" deoplete is for autocompletion +" if has('nvim') + " Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } +" else + " Plug 'Shougo/deoplete.nvim' + " Plug 'roxma/nvim-yarp' + " Plug 'roxma/vim-hug-neovim-rpc' +" endif +" let g:deoplete#enable_at_startup = 1 +" "Commonly used vim helpers +" Plug 'ycm-core/YouCompleteMe' " Plug 'jedi-vim' " Plug 'bling/vim-airline' " Plug 'vim-airline/vim-airline-themes' "Denite, like emacs 'Helm' app " Plug 'Shougo/denite.nvim' +" Plug 'mg979/vim-visual-multi', {'branch': 'master'} "Search " Plug 'ctrlpvim/ctrlp.vim' @@ -85,17 +101,31 @@ Plug 'majutsushi/tagbar' " Plug 'matthewbdaly/vim-filetype-settings' " Plug 'rhysd/vim-grammarous' "cmd :GrammarousCheck, req java +"todo.txt: https://github.com/freitass/todo.txt-vim +Plug 'freitass/todo.txt-vim' +" if localleader is '\' then for todo.txt files: +" s sort +" s+ sort on projects +" j Decrease the priority of the current line +" sd sort on dates +" d set task's date +" x mark task done +" see ':h todo.txt' for more -"External languages -" Plug 'Vigemus/iron.nvim' -" Plug 'bfredl/nvim-ipy' +"External languages, interpreter/repl integration +" Plug 'kassio/neoterm' +" " Plug 'jpalardy/vim-slime' +" #:IPython. F5 exec current line or visual selection +" Plug 'bfredl/nvim-ipy' " Plug 'jalvesaq/Nvim-R' -" Plug 'python-mode/python-mode', { 'branch': 'develop' } +" Plug 'python-mode/python-mode', { 'for': 'python', 'branch': 'develop' } +" jupyter independent ipython repl and other languages too +" Plug 'Vigemus/iron.nvim' "latex " Plug 'lervag/vimtex' -" Plug 'vim-pandoc' +" Plug 'vim-pandoc/vim-pandoc' "Markdown " Plug 'vimwiki/vimwiki' @@ -116,41 +146,54 @@ filetype plugin indent on "let g:polyglot_disabled = ['markdown'] let g:markdown_fenced_languages = ['html','r', 'javascript', 'python', 'sh', 'bash=sh', 'css', 'js=javascript', 'json=javascript'] + "Tagbar config nmap :TagbarToggle + +" from Universal Ctags 0.0.0(a3c87ab5), ctags --list-kinds let g:tagbar_type_markdown = { - \ 'ctagstype' : 'markdown', + \ 'ctagstype' : 'Markdown', \ 'kinds' : [ - \ 'h:Heading_L1', - \ 'i:Heading_L2', - \ 'k:Heading_L3' + \ 'c:Heading_L1', + \ 's:Heading_L2', + \ 'S:Heading_L3', + \ 't:Heading_L4', + \ 'T:Heading_L5', + \ 'u:Heading_L6' \ ] \ } let g:tagbar_type_bib = { - \ 'ctagstype' : 'bib', + \ 'ctagstype' : 'BibTex', \ 'kinds' : [ \ 'a:Articles', \ 'b:Books', - \ 'L:Booklets', + \ 'B:Booklets', \ 'c:Conferences', - \ 'B:Inbook', - \ 'C:Incollection', - \ 'P:Inproceedings', + \ 'i:Inbook', + \ 'I:Incollection', + \ 'J:Inproceedings', \ 'm:Manuals', - \ 'T:Masterstheses', - \ 'M:Misc', - \ 't:Phdtheses', - \ 'p:Proceedings', - \ 'r:Techreports', + \ 'M:Masterstheses', + \ 'n:Misc', + \ 'p:Phdtheses', + \ 'P:Proceedings', + \ 't:Techreports', \ 'u:Unpublished', + \ 's:string' \ ] \ } + "Python repl config -let g:python_host_prog = '/usr/bin/python3' -let g:loaded_python3_provider = 1 -" let g:slime_target = 'neovim' +" let g:loaded_python_provider = 0 +" let g:python3_host_prog = '/usr/bin/python3' +" let g:slime_target = 'tmux' +" let g:slime_python_ipython = 1 +" +"use C-c, C-c to send paragraph or selected text +":SlimeConfig +" https://github.com/jpalardy/vim-slime ":vertical terminal ipython "set updatetime=100 @@ -191,11 +234,25 @@ set expandtab " set hlsearch " set spell -" au BufNewFile,BufRead *.js, *.html, *.css - " \ set tabstop=2 - " \ set softtabstop=2 - " \ set shiftwidth=2 -" +augroup configgroup + autocmd! + autocmd FileType html setlocal tabstop=2 + autocmd FileType html setlocal shiftwidth=2 + autocmd FileType html setlocal softtabstop=2 + autocmd FileType css setlocal tabstop=2 + autocmd FileType css setlocal shiftwidth=2 + autocmd FileType css setlocal softtabstop=2 + autocmd FileType javascript setlocal tabstop=2 + autocmd FileType javascript setlocal shiftwidth=2 + autocmd FileType javascript setlocal softtabstop=2 + " autocmd FileType html setlocal commentstring=#\ %s + autocmd BufEnter *.sh setlocal tabstop=2 + autocmd BufEnter *.sh setlocal shiftwidth=2 + autocmd BufEnter *.sh setlocal softtabstop=2 +augroup END + +" au BufNewFile,BufRead *.js, *.html, *.css set tabstop=2 softtabstop=2 set shiftwidth=2 expandtab + "Mouse/trackpad pointer config " set mouse=a "already set by defaults.vim set mouse=n @@ -248,12 +305,40 @@ set title " let g:Tex_DefaultTargetFormat =" pdf" " let g:Tex_IgnoredWarnings ='' +" vim-pandoc settings +" let g:pandoc#filetypes#handled = ["pandoc", "markdown"] +" let g:pandoc#filetypes#pandoc_markdown = 0 +" let g:pandoc#completion#bib#mode = "citeproc" +" let g:pandoc#modules#disabled = ["folding"] + +" vim-pandoc with deoplete autocomplete for nvim +" if !exists('g:deoplete#omni#input_patterns') + " let g:deoplete#omni#input_patterns = {} +" endif +" let g:deoplete#omni#input_patterns.pandoc = ['@'] +" +" vim-pandoc with youcompleteme +" if !exists('g:ycm_semantic_triggers') + " let g:ycm_semantic_triggers = {} +" endif +" let g:ycm_semantic_triggers.pandoc = ['@'] +" let g:ycm_filetype_blacklist = {} + + "make vimtex work with neovim " let g:vimtex_compiler_progname='nvr' " let g:vimtex_view_use_temp_files=2 " let g:vimtex_view_method='zathura' " let g:vimtex_quickfix_mode=0 " do not open the quickfix window automatically +" use with fzf in insert mode to insert project file name +" inoremap fzf#vim#complete#path('git ls-files $(git rev-parse --show-toplevel)') +" Insert mode completion +imap (fzf-complete-word) +imap (fzf-complete-path) +imap (fzf-complete-file) + + "Allow commenting and inverting empty lines (useful when commenting a region let g:NERDCommentEmptyLines = 1 "Add spaces after comment delimiters by default