@ -1,4 +0,0 @@ | |||
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities. | |||
version: v1.19.0 | |||
ignore: {} | |||
patch: {} |
@ -1,15 +1,15 @@ | |||
{ | |||
"dependencies": { | |||
"coc-css": ">=1.2.6", | |||
"coc-html": ">=1.4.1", | |||
"coc-java": ">=1.5.3", | |||
"coc-jedi": ">=0.25.2", | |||
"coc-json": ">=1.3.4", | |||
"coc-markdownlint": ">=1.11.1", | |||
"coc-prettier": ">=1.1.23", | |||
"coc-css": ">=1.3.0", | |||
"coc-html": ">=1.6.1", | |||
"coc-java": ">=1.5.5", | |||
"coc-java-lombok": ">=1.0.0", | |||
"coc-jedi": ">=0.30.1", | |||
"coc-json": ">=1.4.1", | |||
"coc-markdownlint": ">=1.12.4", | |||
"coc-prettier": ">=9.2.2", | |||
"coc-tailwindcss": ">=0.7.0", | |||
"coc-tsserver": ">=1.6.8", | |||
"coc-vetur": ">=1.2.4", | |||
"coc-vimtex": ">=1.0.4" | |||
"coc-tsserver": ">=1.9.13", | |||
"coc-vimtex": ">=1.1.1" | |||
} | |||
} |
@ -1,25 +0,0 @@ | |||
{ | |||
"languageserver": { | |||
"ccls": { | |||
"command": "ccls", | |||
"filetypes": [ | |||
"c", | |||
"cpp", | |||
"objc", | |||
"objcpp" | |||
], | |||
"rootPatterns": [ | |||
".ccls", | |||
"compile_commands.json", | |||
".vim/", | |||
".git/", | |||
".hg/" | |||
], | |||
"initializationOptions": { | |||
"cache": { | |||
"directory": "/tmp/ccls" | |||
} | |||
} | |||
} | |||
} | |||
} |
@ -0,0 +1,16 @@ | |||
-- Source the plug.vim plugin | |||
vim.cmd('source ~/.config/nvim/colors/material.vim') | |||
vim.cmd('source ~/.vimrc') | |||
-- Load plugins | |||
require('plugin.init') | |||
-- Initialize Keybinds | |||
require('config.init') | |||
-- Initialize LSP | |||
require('lsp.init') | |||
-- Initialize Keybinds | |||
require('keybinds.init') | |||
@ -1 +0,0 @@ | |||
nnoremap <leader>gl :YcmCompleter GoToDeclaration<CR> |
@ -1,138 +0,0 @@ | |||
" Use tab for trigger completion with characters ahead and navigate. | |||
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by | |||
" other plugin before putting this into your config. | |||
inoremap <silent><expr> <TAB> | |||
\ pumvisible() ? "\<C-n>" : | |||
\ <SID>check_back_space() ? "\<TAB>" : | |||
\ coc#refresh() | |||
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>" | |||
function! s:check_back_space() abort | |||
let col = col('.') - 1 | |||
return !col || getline('.')[col - 1] =~# '\s' | |||
endfunction | |||
" Use <c-space> to trigger completion. | |||
if has('nvim') | |||
inoremap <silent><expr> <c-space> coc#refresh() | |||
else | |||
inoremap <silent><expr> <c-@> coc#refresh() | |||
endif | |||
" Make <CR> auto-select the first completion item and notify coc.nvim to | |||
" format on enter, <cr> could be remapped by other vim plugin | |||
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm() : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>" | |||
" Use `[g` and `]g` to navigate diagnostics | |||
" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list. | |||
nmap <silent> [g <Plug>(coc-diagnostic-prev) | |||
nmap <silent> ]g <Plug>(coc-diagnostic-next) | |||
" Coc Prettier | |||
vmap <leader>f <Plug>(coc-format-selected) | |||
nmap <leader>f <Plug>(coc-format-selected) | |||
" GoTo code navigation. | |||
nmap <silent> gd <Plug>(coc-definition) | |||
nmap <silent> gy <Plug>(coc-type-definition) | |||
nmap <silent> gi <Plug>(coc-implementation) | |||
nmap <silent> gr <Plug>(coc-references) | |||
" Use K to show documentation in preview window. | |||
nnoremap <silent> K :call <SID>show_documentation()<CR> | |||
function! s:show_documentation() | |||
if (index(['vim','help'], &filetype) >= 0) | |||
execute 'h '.expand('<cword>') | |||
elseif (coc#rpc#ready()) | |||
call CocActionAsync('doHover') | |||
else | |||
execute '!' . &keywordprg . " " . expand('<cword>') | |||
endif | |||
endfunction | |||
" Highlight the symbol and its references when holding the cursor. | |||
autocmd CursorHold * silent call CocActionAsync('highlight') | |||
" Symbol renaming. | |||
nmap <leader>rn <Plug>(coc-rename) | |||
" Formatting selected code. | |||
xmap <leader>f <Plug>(coc-format-selected) | |||
nmap <leader>f <Plug>(coc-format-selected) | |||
augroup mygroup | |||
autocmd! | |||
" Setup formatexpr specified filetype(s). | |||
autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected') | |||
" Update signature help on jump placeholder. | |||
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') | |||
augroup end | |||
" Applying codeAction to the selected region. | |||
" Example: `<leader>aap` for current paragraph | |||
xmap <leader>a <Plug>(coc-codeaction-selected) | |||
nmap <leader>a <Plug>(coc-codeaction-selected) | |||
" Remap keys for applying codeAction to the current buffer. | |||
nmap <leader>ac <Plug>(coc-codeaction) | |||
" Apply AutoFix to problem on the current line. | |||
nmap <leader>qf <Plug>(coc-fix-current) | |||
" Map function and class text objects | |||
" NOTE: Requires 'textDocument.documentSymbol' support from the language server. | |||
xmap if <Plug>(coc-funcobj-i) | |||
omap if <Plug>(coc-funcobj-i) | |||
xmap af <Plug>(coc-funcobj-a) | |||
omap af <Plug>(coc-funcobj-a) | |||
xmap ic <Plug>(coc-classobj-i) | |||
omap ic <Plug>(coc-classobj-i) | |||
xmap ac <Plug>(coc-classobj-a) | |||
omap ac <Plug>(coc-classobj-a) | |||
" Remap <C-f> and <C-b> for scroll float windows/popups. | |||
if has('nvim-0.4.0') || has('patch-8.2.0750') | |||
nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>" | |||
nnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>" | |||
inoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(1)\<cr>" : "\<Right>" | |||
inoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(0)\<cr>" : "\<Left>" | |||
vnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>" | |||
vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>" | |||
endif | |||
" Use CTRL-S for selections ranges. | |||
" Requires 'textDocument/selectionRange' support of language server. | |||
nmap <silent> <C-s> <Plug>(coc-range-select) | |||
xmap <silent> <C-s> <Plug>(coc-range-select) | |||
" Add `:Format` command to format current buffer. | |||
command! -nargs=0 Format :call CocAction('format') | |||
" Add `:Fold` command to fold current buffer. | |||
command! -nargs=? Fold :call CocAction('fold', <f-args>) | |||
" Add `:OR` command for organize imports of the current buffer. | |||
command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport') | |||
" Add (Neo)Vim's native statusline support. | |||
" NOTE: Please see `:h coc-status` for integrations with external plugins that | |||
" provide custom statusline: lightline.vim, vim-airline. | |||
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')} | |||
" Mappings for CoCList | |||
" Show all diagnostics. | |||
nnoremap <silent><nowait> <space>a :<C-u>CocList diagnostics<cr> | |||
" Manage extensions. | |||
nnoremap <silent><nowait> <space>e :<C-u>CocList extensions<cr> | |||
" Show commands. | |||
nnoremap <silent><nowait> <space>c :<C-u>CocList commands<cr> | |||
" Find symbol of current document. | |||
nnoremap <silent><nowait> <space>o :<C-u>CocList outline<cr> | |||
" Search workspace symbols. | |||
nnoremap <silent><nowait> <space>s :<C-u>CocList -I symbols<cr> | |||
" Do default action for next item. | |||
nnoremap <silent><nowait> <space>j :<C-u>CocNext<CR> | |||
" Do default action for previous item. | |||
nnoremap <silent><nowait> <space>k :<C-u>CocPrev<CR> | |||
" Resume latest coc list. | |||
nnoremap <silent><nowait> <space>p :<C-u>CocListResume<CR> |
@ -1,10 +0,0 @@ | |||
" Use ripgrep if available | |||
if executable('rg') | |||
set grepprg=rg\ --color=never | |||
let g:ctrlp_prompt_mappings = { | |||
\ 'AcceptSelection("e")': [], | |||
\ 'AcceptSelection("t")': ['<cr>'], | |||
\ } | |||
let g:ctrlp_user_command = 'rg %s --files --color=never --glob ""' | |||
let g:ctrlp_use_caching = 1 | |||
endif |
@ -1,9 +0,0 @@ | |||
let g:NERDCreateDefaultMappings = 1 | |||
let g:NERDSpaceDelims = 1 | |||
let g:NERDCompactSexyComs = 1 | |||
let g:NERDDefaultAlign = 'left' | |||
let g:NERDAltDelims_java = 1 | |||
let g:NERDCustomDelimiters = { 'c': { 'left': '/**','right': '*/' } } | |||
let g:NERDCommentEmptyLines = 1 | |||
let g:NERDTrimTrailingWhitespace = 1 | |||
let g:NERDToggleCheckAllLines = 1 |
@ -1,4 +0,0 @@ | |||
" Toggle nerdtree with F10 | |||
map <F10> :NERDTreeToggle<CR> | |||
" Current file in nerdtree | |||
map <F9> :NERDTreeFind<CR> |
@ -1,59 +0,0 @@ | |||
call plug#begin('~/.local/share/vim/plugged') | |||
" Look & Feel | |||
Plug 'kaicataldo/material.vim' | |||
Plug 'itchyny/lightline.vim' | |||
Plug 'mengelbrecht/lightline-bufferline' | |||
Plug 'lambdalisue/nerdfont.vim' | |||
" Addons | |||
Plug 'scrooloose/nerdtree' | |||
Plug 'airblade/vim-gitgutter' | |||
Plug 'tpope/vim-surround' | |||
Plug 'jremmen/vim-ripgrep' | |||
Plug 'blarghmatey/split-expander' | |||
Plug 'sheerun/vim-polyglot' | |||
Plug 'neoclide/coc.nvim', {'branch': 'release'} | |||
Plug 'junegunn/goyo.vim' | |||
Plug 'vim-scripts/indentpython.vim' | |||
Plug 'preservim/nerdcommenter' | |||
Plug 'mileszs/ack.vim' | |||
Plug 'yegappan/taglist' | |||
"Plug 'puremourning/vimspector' | |||
Plug 'lervag/vimtex' | |||
Plug 'gu-fan/riv.vim' | |||
Plug 'isene/hyperlist.vim' | |||
Plug 'neomutt/neomutt.vim' | |||
Plug 'VebbNix/lf-vim' | |||
" Tmux integration | |||
Plug 'benmills/vimux' | |||
Plug 'christoomey/vim-tmux-navigator' | |||
" Neuron | |||
Plug 'oberblastmeister/neuron.nvim', { 'branch' : 'unstable' } | |||
Plug 'nvim-lua/popup.nvim' | |||
Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']} | |||
" File system navigation | |||
Plug 'nvim-lua/plenary.nvim' | |||
Plug 'nvim-telescope/telescope.nvim' | |||
" OCS Yank PLugin for use with Blink Shell | |||
Plug 'ojroques/vim-oscyank' | |||
" Syntax highlighting | |||
Plug 'joelbeedle/pseudo-syntax' | |||
Plug 'rhysd/vim-wasm' | |||
Plug 'elzr/vim-json' | |||
Plug 'tpope/vim-markdown' | |||
Plug 'pangloss/vim-javascript' | |||
Plug 'leafgarland/typescript-vim' | |||
Plug 'vim-scripts/cool.vim' | |||
Plug 'justinmk/vim-syntax-extra' | |||
Plug 'arrufat/vala.vim' | |||
Plug 'Shirk/vim-gas' | |||
call plug#end() |
@ -1,3 +0,0 @@ | |||
" bind K to search word under cursor | |||
nnoremap ,K :Rg <C-R><C-W><CR> | |||
cnoreabbrev <expr> Ag ((getcmdtype() is# ':' && getcmdline() is# 'Ag')?('Rg'):('Ag')) " Map Ag to Rg as well |
@ -1,7 +0,0 @@ | |||
let test#strategy = "vimux" | |||
let test#runners = {} | |||
nmap <silent> <leader>s :TestNearest<CR> | |||
nmap <silent> <leader>t :TestFile<CR> | |||
nmap <silent> <leader>a :TestSuite<CR> | |||
nmap <silent> <leader>l :TestLast<CR> |
@ -1,9 +0,0 @@ | |||
function! RunCommand() | |||
call inputsave() | |||
let replacement = input('Enter Command: ') | |||
call inputrestore() | |||
execute 'call VimuxRunCommand("'.replacement.'")' | |||
endfunction | |||
nnoremap <F5> :call RunCommand()<CR> | |||
nnoremap <F6> :VimuxRunLastCommand<CR> |
@ -0,0 +1,89 @@ | |||
call plug#begin('~/.local/share/vim/plugged') | |||
" Look & Feel | |||
Plug 'kaicataldo/material.vim' | |||
Plug 'itchyny/lightline.vim' | |||
Plug 'mengelbrecht/lightline-bufferline' | |||
Plug 'kyazdani42/nvim-tree.lua' | |||
" Addons | |||
Plug 'mhinz/vim-signify' " Signs | |||
Plug 'tpope/vim-surround' " Surround pieces of text with symbols | |||
Plug 'jremmen/vim-ripgrep' " Better Grep | |||
" Plug 'blarghmatey/split-expander' | |||
Plug 'sheerun/vim-polyglot' " Language Packs | |||
" Plug 'neoclide/coc.nvim', {'branch': 'release'} | |||
Plug 'neovim/nvim-lspconfig' " LSP!!! | |||
Plug 'junegunn/goyo.vim' " Center writing | |||
" Autocomplete | |||
Plug 'hrsh7th/cmp-nvim-lsp' | |||
Plug 'hrsh7th/cmp-buffer' | |||
Plug 'hrsh7th/cmp-path' | |||
Plug 'hrsh7th/cmp-cmdline' | |||
Plug 'Dosx001/cmp-commit' | |||
Plug 'hrsh7th/nvim-cmp' | |||
Plug 'hrsh7th/cmp-nvim-lsp-signature-help' | |||
Plug 'neomutt/neomutt.vim' " Neomuttrc syntex highlighting | |||
Plug 'VebbNix/lf-vim' | |||
" Tmux integration | |||
Plug 'benmills/vimux' | |||
Plug 'christoomey/vim-tmux-navigator' | |||
" File system navigation | |||
Plug 'nvim-lua/plenary.nvim' | |||
Plug 'nvim-telescope/telescope.nvim' | |||
Plug 'nvim-telescope/telescope-file-browser.nvim' | |||
Plug 'gnfisher/nvim-telescope-ctags-plus' | |||
Plug 'jreybert/vimagit' | |||
Plug 'ojroques/vim-oscyank' " OCS Yank PLugin for use with Blink Shell | |||
Plug 'folke/which-key.nvim' " Emacs like keybind suggestions | |||
Plug 'ferrine/md-img-paste.vim' | |||
" === Language Servers === | |||
Plug 'mfussenegger/nvim-jdtls' | |||
" ==== Syntax highlighting ==== | |||
Plug 'joelbeedle/pseudo-syntax' " Pseudocode | |||
Plug 'rhysd/vim-wasm' " Web Assembly | |||
Plug 'elzr/vim-json' " JSON | |||
Plug 'tpope/vim-markdown' "Markdown | |||
Plug 'pangloss/vim-javascript' "Javascript | |||
Plug 'leafgarland/typescript-vim' "Typescript | |||
Plug 'vim-scripts/cool.vim' "COOL, Stanford Compiler Course | |||
Plug 'justinmk/vim-syntax-extra' " A bunch of extra languages | |||
Plug 'arrufat/vala.vim' " Vala | |||
Plug 'Shirk/vim-gas' "GAS Assembly | |||
Plug 'nvim-treesitter/nvim-treesitter' | |||
Plug 'kyazdani42/nvim-web-devicons' " optional, for file icons | |||
Plug 'nicwest/vim-http' | |||
" === Snippets === | |||
Plug 'hrsh7th/cmp-vsnip' | |||
Plug 'hrsh7th/vim-vsnip' | |||
Plug 'rafamadriz/friendly-snippets' " Some snippets for ultisnips | |||
Plug 'folke/zen-mode.nvim' | |||
Plug 'goolord/alpha-nvim' " Welcome screen | |||
Plug 'onsails/lspkind.nvim' " Completion icons | |||
" Telescope extensions | |||
Plug 'nvim-telescope/telescope-ui-select.nvim' | |||
Plug 'mickael-menu/zk-nvim' | |||
Plug 'folke/trouble.nvim' | |||
Plug 'josa42/nvim-lightline-lsp' | |||
Plug 'willchao612/vim-diagon' | |||
Plug 'tpope/vim-fugitive' | |||
Plug 'lervag/vimtex' | |||
Plug 'mfussenegger/nvim-dap' | |||
call plug#end() | |||
@ -0,0 +1,182 @@ | |||
" note do not change the order... | |||
" some of them are overridding privous regrex | |||
"this code made with build-in syntax regrex(and key words), and with some custome regrex(and | |||
"key words) | |||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |||
" gruvbox (dark) | |||
"let orange = "#d65d0e" "special color for numbers | |||
"let black = "#282828" | |||
"let red = "#cc241d" | |||
"let green = "#98971a" | |||
"let yellow = "#d79921" | |||
"let blue = "#458588" | |||
"let purple = "#b16286" | |||
"let cyan = "#689d6a" | |||
"let white = "#a89984" | |||
" one dark | |||
let orange = "#d19a66" "special color for numbers | |||
let black = "#282c34" | |||
let red = "#E06C75" | |||
let green = "#98c379" | |||
let yellow = "#E5C07B" | |||
let blue = "#61AFEF" | |||
let purple = "#C678DD" | |||
let cyan = "#56B6C2" | |||
let white = "#ABB2BF" | |||
" you may chage the color according to your will :) | |||
" main color (for left over words) | |||
syn match main "\w" | |||
execute "highlight main ctermfg=4 guifg=".red | |||
" numbers | |||
syn match posNum "\d" | |||
execute "highlight posNum ctermfg=4 guifg=".orange | |||
" method names() | |||
syn match class ".\w*\((\)\@=" | |||
execute "highlight class ctermfg=4 guifg=".blue | |||
"execute "highlight names which contains numbers | |||
syn match main "\v(\a)\w*\d" | |||
execute "highlight main ctermfg=4 guifg=".red | |||
"all regrex works | |||
" /^import (+);$/mg | |||
" import \zs.*\ze | |||
" \v(^import\s+)@<=.*; | |||
" imported packages | |||
syn match importName "\v(^import\s+)@<=.*;" | |||
execute "highlight importName ctermfg=4 guifg=".yellow | |||
" import | |||
syn match importWord "import " | |||
execute "highlight importWord ctermfg=4 guifg=".purple | |||
" package name | |||
syn match packageName "\v(^package\s+)@<=.*;" | |||
execute "highlight packageName ctermfg=4 guifg=".yellow | |||
" package | |||
syn match packageWord "package " | |||
execute "highlight packageWord ctermfg=4 guifg=".purple | |||
"ex: int, double, char | |||
execute "highlight javaType ctermfg=4 guifg=".purple | |||
"ex: static, throws | |||
execute "highlight javaStorageClass ctermfg=4 guifg=".purple | |||
"class name... basically starts with caps letter | |||
syntax match ClassName display '\<\([A-Z][a-z0-9]*\)\+\>' | |||
syntax match ClassName display '\.\@<=\*' | |||
highlight link ClassName Identifier | |||
execute "highlight ClassName ctermfg=4 guifg=".yellow | |||
" Just some special color, why not? | |||
syn match print " System.out." | |||
execute "highlight print ctermfg=4 guifg=".yellow | |||
"objects (ex: String) | |||
execute "highlight Constant ctermfg=4 guifg=".yellow | |||
" class | |||
syn match javaClassDecl2 " class\> " | |||
execute "highlight javaClassDecl2 ctermfg=4 guifg=".purple | |||
" package | |||
execute "highlight javaExternal ctermfg=4 guifg=".purple | |||
"if else switch | |||
execute "highlight javaConditional ctermfg=4 guifg=".purple | |||
"while for do | |||
execute "highlight javaRepeat ctermfg=4 guifg=".purple | |||
"true flase | |||
execute "highlight javaBoolean ctermfg=4 guifg=".orange | |||
" null | |||
syn match null "\v[ =]null[; ]" | |||
execute "highlight null ctermfg=4 guifg=".orange | |||
" this super | |||
execute "highlight javaTypedef ctermfg=4 guifg=".purple | |||
" var new instanceof | |||
execute "highlight javaOperator ctermfg=4 guifg=".purple | |||
" return | |||
execute "highlight javaStatement ctermfg=4 guifg=".purple | |||
" static synchronized transient volatile final strictfp serializable | |||
execute "highlight javaStorageClass ctermfg=4 guifg=".purple | |||
"throw try catch finally | |||
execute "highlight javaExceptions ctermfg=4 guifg=".purple | |||
" assert | |||
execute "highlight javaAssert ctermfg=4 guifg=".purple | |||
" synchronized throws | |||
execute "highlight javaMethodDecl ctermfg=4 guifg=".red | |||
" extends implements interface | |||
execute "highlight javaClassDecl ctermfg=4 guifg=".red | |||
" interface | |||
execute "highlight javaClassDecl ctermfg=4 guifg=".purple | |||
" break continue skipwhite | |||
execute "highlight javaBranch ctermfg=4 guifg=".purple | |||
" public protected private abstract | |||
execute "highlight javaScopeDecl ctermfg=4 guifg=".purple | |||
""""""""""""""""""""""""""""""""""""""' | |||
" java 9... | |||
" module transitive | |||
execute "highlight javaModuleStorageClass ctermfg=4 guifg=".purple | |||
" open requires exports opens uses provides | |||
execute "highlight javaModuleStmt ctermfg=4 guifg=".yellow | |||
" to with | |||
execute "highlight javaModuleExternal ctermfg=4 guifg=".red | |||
""""""""""""""""""""""""""""""""""""""""" | |||
" lambda | |||
execute "highlight javaLambdaDef ctermfg=4 guifg=".cyan | |||
"""""""""""""""""""""""""""""""""""""""""" | |||
" clone equals finalize getClass hashCode | |||
" notify notifyAll toString wait | |||
execute "highlight javaLangObject ctermfg=4 guifg=".yellow | |||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |||
@ -1,240 +0,0 @@ | |||
"" __ _______ _____ _____ | |||
"" \ \ / / ____| ____|_ _| | |||
"" \ V /| _| | _| | | | |||
"" | | | |___| |___ | | | |||
"" |_| |_____|_____| |_| | |||
"" Yeet's vim configuration | |||
" XDG Base Directory Specification | |||
set runtimepath^=$XDG_CONFIG_HOME/vim | |||
set runtimepath+=$XDG_DATA_HOME/vim | |||
set runtimepath+=$XDG_CONFIG_HOME/vim/after | |||
set packpath^=$XDG_DATA_HOME/vim,$XDG_CONFIG_HOME/vim | |||
set packpath+=$XDG_CONFIG_HOME/vim/after,$XDG_DATA_HOME/vim/after | |||
let g:netrw_home = $XDG_DATA_HOME."/vim" | |||
call mkdir($XDG_DATA_HOME."/vim/spell", 'p') | |||
set viewdir=$XDG_DATA_HOME/vim/view | call mkdir(&viewdir, 'p') | |||
set backupdir=$XDG_CACHE_HOME/vim/backup | call mkdir(&backupdir, 'p') | |||
set directory=$XDG_CACHE_HOME/vim/swap | call mkdir(&directory, 'p') | |||
set undodir=$XDG_CACHE_HOME/vim/undo | call mkdir(&undodir, 'p') | |||
let s:MRU_File = $XDG_CACHE_HOME."/vim/mru" | |||
if !has('nvim') | set viminfofile=$XDG_CACHE_HOME/vim/viminfo | endif | |||
" Set leader | |||
let mapleader = "," | |||
" Leader Mappings | |||
nnoremap <Leader>c :w! \| !compiler "<c-r>%"<CR> | |||
map <Leader>w :update<CR> | |||
map <Leader>q :qall<CR> | |||
map <Leader>gs :Gstatus<CR> | |||
" map Q to gq for line formatting cuz Q is useless | |||
nnoremap Q gq | |||
" Recently edited files | |||
map <Leader>h :History<CR> | |||
" CtrlP use FZF (faster!) | |||
nnoremap <C-p> :Telescope find_files<cr> | |||
" ,b Buffers | |||
nnoremap <Leader>b :Buffers<CR> | |||
" ,u urlview | |||
noremap <Leader>u :w<Home>silent <End> !urlview<CR> | |||
" System clipboard copy | |||
nnoremap <Leader>y "+y | |||
nnoremap <Leader>p "+p | |||
vnoremap <Leader>y "+y | |||
vnoremap <Leader>p "+p | |||
nnoremap <Leader>Y "+Y | |||
nnoremap <Leader>P "+P | |||
vnoremap <Leader>d "+d | |||
nnoremap <Leader>D "+D | |||
if has('nvim') | |||
source ~/.config/nvim/plugin/plugins.vim | |||
endif | |||
syntax on | |||
filetype plugin on | |||
set autoread " Auto reload changed files | |||
set wildmenu " Tab autocomplete in command mode | |||
set backspace=indent,eol,start " http://vi.stackexchange.com/a/2163 | |||
set laststatus=2 " Show status line on startup | |||
set splitright " Open new splits to the right | |||
set splitbelow " Open new splits to the bottom | |||
set lazyredraw " Reduce the redraw frequency | |||
set ttyfast " Send more characters in fast terminals | |||
set nowrap " Don't wrap long lines | |||
set listchars=extends:→ " Show arrow if line continues rightwards | |||
set listchars+=precedes:← " Show arrow if line continues leftwards | |||
set nobackup nowritebackup noswapfile " Turn off backup files | |||
set noerrorbells novisualbell " Turn off visual and audible bells | |||
set expandtab shiftwidth=2 tabstop=2 " Two spaces for tabs everywhere | |||
set history=500 | |||
set hidden " Save buffers automatically | |||
set ignorecase smartcase " Search queries intelligently set case | |||
set incsearch " Show search results as you type | |||
set timeoutlen=1000 ttimeoutlen=0 " Remove timeout when hitting escape | |||
set showcmd " Show size of visual selection | |||
set cmdheight=2 | |||
set t_Co=256 | |||
noh | |||
" set clipboard=unnamedplus | |||
set shortmess+=c | |||
set updatetime=300 | |||
if has("patch-8.1.1564") | |||
" Recently vim can merge signcolumn and number column into one | |||
set signcolumn=number | |||
else | |||
set signcolumn=yes | |||
endif | |||
" Persistent undo | |||
set undodir=~/.local/share/vim/undo/ | |||
set undofile | |||
set undolevels=1000 | |||
set undoreload=10000 | |||
" Ignored files/directories from autocomplete (and CtrlP) | |||
set wildignore+=*/tmp/* | |||
set wildignore+=*.so | |||
set wildignore+=*.zip | |||
set wildignore+=*/vendor/bundle/* | |||
set wildignore+=*/node_modules/ | |||
" Enable autocompletion: | |||
set wildmode=longest,list,full | |||
" Disables automatic commenting on newline: | |||
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o | |||
vnoremap . :normal .<CR> | |||
map <leader>f :Goyo \| set linebreak<CR> | |||
map <leader>o :setlocal spell! spelllang=en_us<CR> | |||
set splitbelow splitright | |||
map <leader>s :!clear && shellcheck -x %<CR> | |||
cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit! | |||
"------------------------------------------------------------------------------- | |||
" Interface | |||
"------------------------------------------------------------------------------- | |||
set number " Enable line numbers | |||
set scrolloff=5 " Leave 5 lines of buffer when scrolling | |||
set sidescrolloff=10 " Leave 10 characters of horizontal buffer when scrolling | |||
"------------------------------------------------------------------------------- | |||
" Colors & Formatting | |||
"------------------------------------------------------------------------------- | |||
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum" | |||
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum" | |||
if (has("termguicolors")) | |||
set termguicolors | |||
endif | |||
let g:material_theme_style='ocean-community' | |||
set background=dark | |||
try | |||
colorscheme material | |||
catch /^Vim\%((\a\+)\)\=:E185/ | |||
colorscheme default | |||
endtry | |||
" Showcase comments in italics | |||
highlight Comment cterm=italic gui=italic | |||
" Easy tab navigation | |||
nnoremap <C-Left> :tabprevious<CR> | |||
nnoremap <C-Right> :tabnext<CR> | |||
" Find/replace | |||
vnoremap <C-r> "hy:%s/<C-r>h//g<left><left><left> | |||
" DON'T USE ARROWS NORMIE | |||
nnoremap <C-c> :echoe "Use Esc"<CR> | |||
nnoremap <Left> :echoe "Use h"<CR> | |||
nnoremap <Right> :echoe "Use l"<CR> | |||
nnoremap <Up> :echoe "Use k"<CR> | |||
nnoremap <Down> :echoe "Use j"<CR> | |||
" Split resize | |||
nnoremap <silent> <Leader>+ :exe "resize " . (winheight(0) * 3/2)<CR> | |||
nnoremap <silent> <Leader>- :exe "resize " . (winheight(0) * 2/3)<CR> | |||
" Make vim obey transparency | |||
hi! Normal ctermbg=NONE guibg=NONE | |||
hi! NonText ctermbg=NONE guibg=NONE | |||
"------------------------------------------------------------------------------- | |||
" Neovim-specific configurations | |||
if has('nvim') | |||
let $NVIM_TUI_ENABLE_TRUE_COLOR=1 | |||
set termguicolors | |||
" Fix vim-tmux-navigator <C-h> https://git.io/viGRU | |||
nmap <BS> <C-W>h | |||
" Fix vim-tmux-navigator <C-h> https://git.io/vS5QH | |||
nmap <BS> :<C-u>TmuxNavigateLeft<CR> | |||
" The following require plugins to be loaded so they should only be set in neovim | |||
let g:vimtex_view_general_viewer = 'zathura' | |||
" Syntastic max file size for python | |||
let g:syntastic_python_pylint_post_args="--max-line-length=120" | |||
" Widths fot several plugins | |||
let g:goyo_width = 120 " Goyo | |||
let g:Tlist_WinWidth = 40 " Tlist | |||
lua <<EOF | |||
require'neuron'.setup { | |||
virtual_titles = true, | |||
mappings = true, | |||
run = nil, -- function to run when in neuron dir | |||
neuron_dir = "~/Projects/Neocortex", -- the directory of all of your notes, expanded by default (currently supports only one directory for notes, find a way to detect neuron.dhall to use any directory) | |||
leader = "gz", -- the leader key to for all mappings, remember with 'go zettel' | |||
} | |||
EOF | |||
endif | |||
" Don't clear clipboard on exit | |||
autocmd VimLeave * call system("xsel -ib", getreg('+')) | |||
" Useful for GDB debugging | |||
packadd termdebug | |||
" File Specific Settings | |||
if has("autocmd") | |||
" Use skeleton files | |||
augroup templates | |||
autocmd BufNewFile *.* silent! execute '0r ~/.config/vim/templates/skeleton.'.expand("<afile>:e") | |||
autocmd BufNewFile * %substitute#\[:VIM_EVAL:\]\(.\{-\}\)\[:END_EVAL:\]#\=eval(submatch(1))#ge | |||
augroup END | |||
autocmd BufWinLeave *.tex !texclear %:p " Run texclear on exit | |||
autocmd BufRead calcurse-note.* :set filetype=markdown " Use markdown for calcurse notes | |||
endif | |||
@ -0,0 +1,35 @@ | |||
#!/bin/sh | |||
function menu { | |||
dmenu -i -l 20 $@ | |||
} | |||
function refresh { | |||
echo "refresh" | |||
} | |||
current=$(hamster current) | |||
# choose an action | |||
if [ "No activity" = "$current" ]; then | |||
action="start" | |||
else | |||
action=$(echo -e -n "start\nstop $current" | menu -p Action) | |||
fi | |||
[ -z "$action" ] && exit 1 | |||
case "$action" in | |||
start) | |||
activity=$(hamster activities | menu -p Start) | |||
[ -z "$activity" ] && exit 1 | |||
hamster start $activity | |||
notify-send "Started $activity" | |||
refresh | |||
;; | |||
stop*) | |||
hamster stop | |||
notify-send "Stopped $current" | |||
refresh | |||
;; | |||
esac |
@ -0,0 +1,22 @@ | |||
#!/bin/sh | |||
if [ ! -d "$XDG_CONFIG_HOME/sessions" ]; then | |||
mkdir -p "$XDG_CONFIG_HOME/sessions" | |||
fi | |||
list="" | |||
for i in $(ls -1 "$XDG_CONFIG_HOME/sessions/"); do | |||
list="${list}${i} : $(head -n 1 "$XDG_CONFIG_HOME/sessions/$i" | sed 's/# //g')\n" | |||
done | |||
selection=$(printf "$list" | dmenu -l 4 | sed 's/ :.*//g') | |||
echo "$selection" | |||
if [ ! -f "$XDG_CONFIG_HOME/sessions/$selection" ]; then | |||
touch "$XDG_CONFIG_HOME/sessions/$selection" | |||
st -c vim -n vim -e "$EDITOR" "$XDG_CONFIG_HOME/sessions/$selection" | |||
else | |||
bash "$XDG_CONFIG_HOME/sessions/$selection" | |||
fi | |||
@ -0,0 +1,23 @@ | |||
#!/bin/sh | |||
if [ ! -f $XDG_RUNTIME_DIR/timer ] || [ -z $(cat $XDG_RUNTIME_DIR/timer) ]; then | |||
duration="$(printf "" | dmenu -p "Please enter duration:")" | |||
[ -z "$duration" ] && exit 1 | |||
timestamp="$(date -d "$duration" '+%s')" | |||
[ -z "$timestamp" ] && notify-send -a "Timer utility" "Time format not recognized" && exit 1 | |||
printf "$timestamp" > $XDG_RUNTIME_DIR/timer | |||
else | |||
operation=$(printf "Cancel" | dmenu -p "Please select action:") | |||
case $operation in | |||
Cancel) | |||
echo "" > $XDG_RUNTIME_DIR/timer | |||
;; | |||
esac | |||
fi | |||
kill -64 $(pidof dwmblocks) |
@ -0,0 +1,39 @@ | |||
#!/bin/sh | |||
read -r -d '' MENU << EOM | |||
Arch Wiki | Open an entry from the Arch Wiki (offline) | dmenu-ambient | |||
Bluetooth | Manage bluetooth and bluetooth devices | dmenu-bluetooth | |||
Read Books | Connect to calibre-web and read a book | dmenu-books | |||
Edit Config | Select and edit configuration files in your dotfiles | dmenu-edit | |||
Kill Process | Kill a process that is bothering you | dmenu-killall | |||
Mobile Device | Manage your mobile device through mconnect | dmenu-mconnect | |||
Record Screen | Record your screen, voice or anything | dmenu-record | |||
Mount Storage Devices | Manage connected detachable storage devices | dmenu-udevil | |||
Unmount Storage Devices | Manage connected detachable storage devices | dmenu-udevil -u | |||
Word Count | Count the words, letters and lines in any string | dmenu-wc | |||
Grab Color | Grab any color on your screen | grabcolor | |||
Sync Mail | Synchronize your mail | mailsync | |||
Toggle Trackpad | Enable/Disable your trackpad | toggle_trackpad.sh | |||
Sync Nextcloud | Synchronize with your nextcloud instance | nextcloud-sync | |||
Network Settings | Manage network settings using connman | connman_dmenu | |||
Backup | Backup your system | backup | |||
Ambient Sounds | Play ambient sounds | dmenu-ambient | |||
Insert Emoji | Insert an emoji or glyph | dmenu-emoji | |||
Create Timer | Create or manage a timer | dmenu-timer | |||
Watch Youtube | Search and watch a youtube video | ytfzf_dmenu | |||
EOM | |||
selection=$(printf "$MENU" | column -s '|' -t | dmenu -p "Select a tool" -l 7) | |||
[ -z "$selection" ] && exit | |||
cmd=$(echo "$selection" | sed 's/\s\{2,\}/\n/g' | tail -n 1) | |||
bash -c "$cmd" | |||
@ -1,73 +0,0 @@ | |||
#!/bin/sh | |||
itemcache="${XDG_DATA_HOME:-$HOME/.cache}/wallabag-dmenu" | |||
DMENU=${DMENU:-dmenu} | |||
usage() { | |||
cat <<-EOF | |||
usage: dmenu-wallabag [-lah] | |||
-l List Entries | |||
-s Select Menu | |||
-a Add an entry | |||
-h Print help | |||
EOF | |||
} | |||
update_items(){ | |||
[ "$(date -r "$itemcache" "+%d-%m-%Y %H")" = "$(date '+%d-%m-%Y') %H" ] || | |||
wallabag list | head -n -1 | tail -n +2 > $itemcache | |||
} | |||
list_entries() { | |||
update_items | |||
items="$(cat $itemcache)" | |||
selection=$(echo -e "$items\n~SYNC~" | dmenu -l 10 -p "Choose an article:") | |||
if [ "$selection" = "~SYNC~" ]; then | |||
wallabag list | head -n -1 | tail -n +2 > $itemcache | |||
items="$(cat $itemcache)" | |||
selection=$(echo "$items" | dmenu -l 10 -p "Choose an article:") | |||
fi | |||
if [ "$selection" = "" ]; then | |||
exit | |||
fi | |||
selection=$(echo "$selection" | cut -d" " -f1) | |||
wallabag update --read $selection | |||
wallabag open $selection | |||
wallabag list | head -n -1 | tail -n +2 > $itemcache | |||
} | |||
add_entry() { | |||
url=$(echo -n "" | dmenu -p "Enter URL:") | |||
if [ "$url" = "" ]; then | |||
exit | |||
fi | |||
wallabag add $url | |||
wallabag list | head -n -1 | tail -n +2 > $itemcache | |||
} | |||
select_mode() { | |||
menu="Read\nAdd" | |||
action=$(echo -e "$menu" | dmenu -p "Select action: ") | |||
if [ "$action" = "" ]; then | |||
return | |||
fi | |||
if [ "$action" = "Read" ];then | |||
list_entries | |||
else | |||
add_entry | |||
fi | |||
} | |||
while getopts ':lahs' opt; do | |||
case "$opt" in | |||
l) list_entries ;; | |||
s) select_mode;; | |||
a) add_entry ;; | |||
h) usage && exit;; | |||
/?) echo "Unrecognized command: $OPTARG";; | |||
esac | |||
done | |||
@ -0,0 +1,10 @@ | |||
#!/bin/sh | |||
activity=$(hamster current) | |||
if [[ "$activity" == "No activity" ]]; then | |||
activity="None" | |||
fi | |||
echo "^c#ebcb8b^﨟 ^d^${activity}" | |||
@ -0,0 +1,30 @@ | |||
#!/bin/sh | |||
icon= | |||
now=$(date '+%s') | |||
if [ ! -f "$XDG_RUNTIME_DIR/timer" ]; then | |||
end=0 | |||
else | |||
content=$(cat "$XDG_RUNTIME_DIR/timer") | |||
if [ -z "$content" ]; then | |||
end=0 | |||
else | |||
end="$content" | |||
fi | |||
fi | |||
if [ $end != 0 ]; then | |||
if [ $now -ge $end ]; then | |||
canberra-gtk-play -i alarm-clock-elapsed -V 10 | |||
echo "" > "$XDG_RUNTIME_DIR/timer" | |||
else | |||
diff=$(expr $end - $now) | |||
str=$(date -ud @$diff '+%H:%M:%S' | sed 's/^00://g') | |||
echo "^c#a48ead^$icon ^d^ $str" | |||
fi | |||
else | |||
echo "^c#a48ead^$icon ^d^ NONE" | |||
fi | |||
@ -1,6 +1,6 @@ | |||
#!/bin/sh | |||
export YTFZF_EXTMENU=' dmenu -i -l 12' | |||
action=$(echo "" | dmenu -p "Search YouTube") | |||
action=$(printf "" | dmenu -p "Search YouTube") | |||
ytfzf -D "$action" |
@ -1,4 +1,5 @@ | |||
pinentry-program /usr/bin/pinentry-qt | |||
no-grab | |||
allow-preset-passphrase | |||
max-cache-ttl 172800 | |||
max-cache-ttl 34560000 | |||
default-cache-ttl 34560000 |