summaryrefslogtreecommitdiffstats
path: root/.config
diff options
context:
space:
mode:
Diffstat (limited to '.config')
l---------.config/cava1
l---------.config/dunst1
l---------.config/git1
l---------.config/gtk-2.01
l---------.config/gtk-3.01
l---------.config/mpd1
l---------.config/mpv1
l---------.config/ncmpcpp1
-rw-r--r--.config/nvim/autocomplete.lua115
-rw-r--r--.config/nvim/init.vim181
l---------.config/shell1
l---------.config/sxhkd1
l---------.config/sxiv1
l---------.config/x111
l---------.config/xmodmap1
l---------.config/zsh1
16 files changed, 310 insertions, 0 deletions
diff --git a/.config/cava b/.config/cava
new file mode 120000
index 0000000..588c6a5
--- /dev/null
+++ b/.config/cava
@@ -0,0 +1 @@
+.config/cava \ No newline at end of file
diff --git a/.config/dunst b/.config/dunst
new file mode 120000
index 0000000..b50b834
--- /dev/null
+++ b/.config/dunst
@@ -0,0 +1 @@
+.config/dunst \ No newline at end of file
diff --git a/.config/git b/.config/git
new file mode 120000
index 0000000..bb57838
--- /dev/null
+++ b/.config/git
@@ -0,0 +1 @@
+.config/git \ No newline at end of file
diff --git a/.config/gtk-2.0 b/.config/gtk-2.0
new file mode 120000
index 0000000..41d87ea
--- /dev/null
+++ b/.config/gtk-2.0
@@ -0,0 +1 @@
+.config/gtk-2.0 \ No newline at end of file
diff --git a/.config/gtk-3.0 b/.config/gtk-3.0
new file mode 120000
index 0000000..1546249
--- /dev/null
+++ b/.config/gtk-3.0
@@ -0,0 +1 @@
+.config/gtk-3.0 \ No newline at end of file
diff --git a/.config/mpd b/.config/mpd
new file mode 120000
index 0000000..64d0b1f
--- /dev/null
+++ b/.config/mpd
@@ -0,0 +1 @@
+.config/mpd \ No newline at end of file
diff --git a/.config/mpv b/.config/mpv
new file mode 120000
index 0000000..8da66cc
--- /dev/null
+++ b/.config/mpv
@@ -0,0 +1 @@
+.config/mpv \ No newline at end of file
diff --git a/.config/ncmpcpp b/.config/ncmpcpp
new file mode 120000
index 0000000..2ae267b
--- /dev/null
+++ b/.config/ncmpcpp
@@ -0,0 +1 @@
+.config/ncmpcpp \ No newline at end of file
diff --git a/.config/nvim/autocomplete.lua b/.config/nvim/autocomplete.lua
new file mode 100644
index 0000000..f820a2a
--- /dev/null
+++ b/.config/nvim/autocomplete.lua
@@ -0,0 +1,115 @@
+-- Set up nvim-cmp.
+ local cmp = require'cmp'
+
+ cmp.setup({
+ snippet = {
+ -- REQUIRED - you must specify a snippet engine
+ expand = function(args)
+ vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
+ -- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
+ -- require('snippy').expand_snippet(args.body) -- For `snippy` users.
+ -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
+ end,
+ },
+ window = {
+ completion = cmp.config.window.bordered({
+ winhighlight = 'Normal:ModeMsg,FloatBorder:ModMsg,CursorLine:CursorLineNr,Search:None'
+ }),
+ documentation = cmp.config.window.bordered({
+ winhighlight = 'Normal:ModeMsg,FloatBorder:ModMsg,CursorLine:CursorLineNr,Search:None'
+ }),
+ },
+ mapping = cmp.mapping.preset.insert({
+ ['<C-b>'] = cmp.mapping.scroll_docs(-4),
+ ['<C-f>'] = cmp.mapping.scroll_docs(4),
+ ['<C-Space>'] = cmp.mapping.complete(),
+ ['<C-e>'] = cmp.mapping.abort(),
+ ['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
+ }),
+ sources = cmp.config.sources({
+ { name = 'nvim_lsp' },
+ { name = 'vsnip' }, -- For vsnip users.
+ -- { name = 'luasnip' }, -- For luasnip users.
+ -- { name = 'ultisnips' }, -- For ultisnips users.
+ -- { name = 'snippy' }, -- For snippy users.
+ }, {
+ { name = 'buffer' },
+ })
+ })
+
+ -- Set configuration for specific filetype.
+ cmp.setup.filetype('gitcommit', {
+ sources = cmp.config.sources({
+ { name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git).
+ }, {
+ { name = 'buffer' },
+ })
+ })
+
+ -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
+ cmp.setup.cmdline({ '/', '?' }, {
+ mapping = cmp.mapping.preset.cmdline(),
+ sources = {
+ { name = 'buffer' }
+ }
+ })
+
+ -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
+ cmp.setup.cmdline(':', {
+ mapping = cmp.mapping.preset.cmdline(),
+ sources = cmp.config.sources({
+ { name = 'path' }
+ }, {
+ { name = 'cmdline' }
+ })
+ })
+
+ require('mason').setup({
+ ui = {
+ icons = {
+ package_installed = "✓",
+ package_pending = "➜",
+ package_uninstalled = "✗"
+ }
+ }
+})
+local capabilities = require('cmp_nvim_lsp').default_capabilities()
+local lspconfig = require('lspconfig')
+local util = require('lspconfig/util')
+ require('mason').setup()
+ require('mason-lspconfig').setup()
+ require('mason-lspconfig').setup_handlers {
+ function(server_name) --default handler (optional)
+ require('lspconfig')[server_name].setup{}
+ end,
+ }
+ -- Set up lspconfig.
+-- local capabilities = require('cmp_nvim_lsp').default_capabilities()
+ -- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled.
+-- require('lspconfig').rust_analyzer.setup {
+-- capabilities = capabilities
+-- }
+-- require('lspconfig').html.setup {
+-- capabilities = capabilities
+-- }
+lspconfig.html.setup({
+ capabilities = capabilities,
+ filetypes = { "html" },
+ settings = {
+ html = {
+ validate = true,
+ },
+ },
+})
+lspconfig.rust_analyzer.setup({
+ capabilities = capabilities,
+ filetypes = { "rust" },
+ root_dir = util.root_pattern("Cargo.toml"),
+ settings = {
+ ['rust-analyzer'] = {
+ cargo = {
+ allFeatures = true,
+ },
+ },
+ },
+})
diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim
new file mode 100644
index 0000000..9510f19
--- /dev/null
+++ b/.config/nvim/init.vim
@@ -0,0 +1,181 @@
+let mapleader =","
+
+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 'tpope/vim-surround'
+Plug 'preservim/nerdtree'
+Plug 'neovim/nvim-lspconfig'
+Plug 'hrsh7th/cmp-nvim-lsp'
+Plug 'hrsh7th/vim-vsnip'
+Plug 'hrsh7th/vim-vsnip-integ'
+Plug 'hrsh7th/cmp-buffer'
+Plug 'hrsh7th/cmp-path'
+Plug 'williamboman/mason.nvim'
+Plug 'williamboman/mason-lspconfig.nvim'
+Plug 'hrsh7th/cmp-cmdline'
+Plug 'hrsh7th/nvim-cmp'
+Plug 'junegunn/goyo.vim'
+Plug 'jreybert/vimagit'
+Plug 'lukesmithxyz/vimling'
+Plug 'vimwiki/vimwiki'
+Plug 'vim-airline/vim-airline'
+Plug '907th/vim-auto-save'
+Plug 'akinsho/toggleterm.nvim'
+Plug 'junegunn/goyo.vim'
+Plug 'tpope/vim-commentary'
+Plug 'andweeb/presence.nvim'
+Plug 'ap/vim-css-color'
+call plug#end()
+
+set title
+set bg=dark
+set go=a
+set mouse=a
+set nohlsearch
+set clipboard+=unnamedplus
+set noshowmode
+set noruler
+set laststatus=0
+set noshowcmd
+
+
+" Some basics:
+ nnoremap c "_c
+ set nocompatible
+ filetype plugin on
+ syntax on
+ set encoding=utf-8
+ set number relativenumber
+" Enable autocompletion:
+ set wildmode=longest,list,full
+" Disables automatic commenting on newline:
+ autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
+" Perform dot commands over visual blocks:
+ vnoremap . :normal .<CR>
+" Goyo plugin makes text more readable when writing prose:
+ map <leader>f :Goyo \| set bg=light \| set linebreak<CR>
+" Spell-check set to <leader>o, 'o' for 'orthography':
+ map <leader>o :setlocal spell! spelllang=en_us<CR>
+" Splits open at the bottom and right, which is non-retarded, unlike vim defaults.
+ set splitbelow splitright
+
+" Nerd tree
+ map <leader>n :NERDTreeToggle<CR>
+ autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
+ if has('nvim')
+ let NERDTreeBookmarksFile = stdpath('data') . '/NERDTreeBookmarks'
+ else
+ let NERDTreeBookmarksFile = '~/.vim' . '/NERDTreeBookmarks'
+ endif
+
+" Vim-Auto-Save
+let g:auto_save = 1 " enable AutoSave on Vim startup
+
+" vimling:
+ nm <leader><leader>d :call ToggleDeadKeys()<CR>
+ imap <leader><leader>d <esc>:call ToggleDeadKeys()<CR>a
+ nm <leader><leader>i :call ToggleIPA()<CR>
+ imap <leader><leader>i <esc>:call ToggleIPA()<CR>a
+ nm <leader><leader>q :call ToggleProse()<CR>
+
+" Shortcutting split navigation, saving a keypress:
+ map <C-h> <C-w>h
+ map <C-j> <C-w>j
+ map <C-k> <C-w>k
+ map <C-l> <C-w>l
+
+" Replace ex mode with gq
+ map Q gq
+
+" Check file in shellcheck:
+ map <leader>s :!clear && shellcheck -x %<CR>
+
+" Open my bibliography file in split
+ map <leader>b :vsp<space>$BIB<CR>
+ map <leader>r :vsp<space>$REFER<CR>
+
+" Replace all is aliased to S.
+ nnoremap S :%s//g<Left><Left>
+
+" Compile document, be it groff/LaTeX/markdown/etc.
+ map <leader>c :w! \| !compiler "<c-r>%"<CR>
+
+" Open corresponding .pdf/.html or preview
+ map <leader>p :!opout <c-r>%<CR><CR>
+
+" Runs a script that cleans out tex build files whenever I close out of a .tex file.
+ autocmd VimLeave *.tex !texclear %
+
+" Setup toggleterm
+ lua require("toggleterm").setup()
+
+" Keybindings for ToggleTerm
+ map <leader>t :ToggleTerm<CR>
+
+" Ensure files are read as what I want:
+ let g:vimwiki_ext2syntax = {'.Rmd': 'markdown', '.rmd': 'markdown','.md': 'markdown', '.markdown': 'markdown', '.mdown': 'markdown'}
+ map <leader>v :VimwikiIndex<CR>
+ let g:vimwiki_list = [{'path': '~/.local/share/nvim/vimwiki', 'syntax': 'markdown', 'ext': '.md'}]
+ autocmd BufRead,BufNewFile /tmp/calcurse*,~/.calcurse/notes/* set filetype=markdown
+ autocmd BufRead,BufNewFile *.ms,*.me,*.mom,*.man set filetype=groff
+ autocmd BufRead,BufNewFile *.tex set filetype=tex
+
+" Save file as sudo on files that require root permission
+ cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> 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!<CR>
+ autocmd BufRead,BufNewFile /tmp/neomutt* map ZQ :Goyo\|q!<CR>
+
+" 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
+ autocmd BufWritePre * %s/\n\+\%$//e
+ autocmd BufWritePre *.[ch] %s/\%$/\r/e
+ autocmd BufWritePre * cal cursor(currPos[1], currPos[2])
+
+" When shortcut files are updated, renew bash and ranger configs with new material:
+ autocmd BufWritePost bm-files,bm-dirs !shortcuts
+" 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
+ highlight! link DiffText MatchParen
+endif
+
+" Function for toggling the bottom statusbar:
+let s:hidden_all = 0
+function! ToggleHiddenAll()
+ if s:hidden_all == 0
+ let s:hidden_all = 1
+ set noshowmode
+ set noruler
+ set laststatus=0
+ set noshowcmd
+ else
+ let s:hidden_all = 0
+ set showmode
+ set ruler
+ set laststatus=2
+ set showcmd
+ endif
+endfunction
+nnoremap <leader>h :call ToggleHiddenAll()<CR>
+" Load command shortcuts generated from bm-dirs and bm-files via shortcuts script.
+" Here leader is ";".
+" So ":vs ;cfz" will expand into ":vs /home/<user>/.config/zsh/.zshrc"
+" if typed fast without the timeout.
+source ~/.config/nvim/shortcuts.vim
+source ~/.config/nvim/autocomplete.lua
diff --git a/.config/shell b/.config/shell
new file mode 120000
index 0000000..b47bd35
--- /dev/null
+++ b/.config/shell
@@ -0,0 +1 @@
+.config/shell \ No newline at end of file
diff --git a/.config/sxhkd b/.config/sxhkd
new file mode 120000
index 0000000..4cf7bf7
--- /dev/null
+++ b/.config/sxhkd
@@ -0,0 +1 @@
+.config/sxhkd \ No newline at end of file
diff --git a/.config/sxiv b/.config/sxiv
new file mode 120000
index 0000000..823168f
--- /dev/null
+++ b/.config/sxiv
@@ -0,0 +1 @@
+.config/sxiv \ No newline at end of file
diff --git a/.config/x11 b/.config/x11
new file mode 120000
index 0000000..f4fe108
--- /dev/null
+++ b/.config/x11
@@ -0,0 +1 @@
+.config/x11 \ No newline at end of file
diff --git a/.config/xmodmap b/.config/xmodmap
new file mode 120000
index 0000000..3c2664a
--- /dev/null
+++ b/.config/xmodmap
@@ -0,0 +1 @@
+.config/xmodmap \ No newline at end of file
diff --git a/.config/zsh b/.config/zsh
new file mode 120000
index 0000000..127b44d
--- /dev/null
+++ b/.config/zsh
@@ -0,0 +1 @@
+.config/zsh \ No newline at end of file