├── .gitignore ├── config ├── nvim │ ├── .gitignore │ ├── lua │ │ ├── plugins │ │ │ ├── vim-rooter │ │ │ │ └── init.lua │ │ │ ├── bookmarks │ │ │ │ └── init.lua │ │ │ ├── lspsaga │ │ │ │ └── init.lua │ │ │ ├── hop │ │ │ │ └── init.lua │ │ │ ├── kommentary │ │ │ │ └── init.lua │ │ │ ├── toggleterm │ │ │ │ └── init.lua │ │ │ ├── floaterm │ │ │ │ └── init.lua │ │ │ ├── closetag │ │ │ │ └── init.lua │ │ │ ├── lspkind │ │ │ │ └── init.lua │ │ │ ├── indentline │ │ │ │ └── init.lua │ │ │ ├── treesitter │ │ │ │ └── init.lua │ │ │ ├── emmet │ │ │ │ └── init.lua │ │ │ ├── dashboard │ │ │ │ └── init.lua │ │ │ ├── lightbulb │ │ │ │ └── init.lua │ │ │ ├── nvim-tree │ │ │ │ └── init.lua │ │ │ ├── autopairs │ │ │ │ └── init.lua │ │ │ ├── nvim-compe │ │ │ │ └── init.lua │ │ │ ├── telescope │ │ │ │ └── init.lua │ │ │ └── galaxyline │ │ │ │ └── init.lua │ │ ├── lsp │ │ │ ├── python.lua │ │ │ ├── graphql.lua │ │ │ ├── css.lua │ │ │ ├── bash.lua │ │ │ ├── html.lua │ │ │ ├── json.lua │ │ │ ├── ts.lua │ │ │ ├── prisma.lua │ │ │ ├── emmet.lua │ │ │ ├── lua-ls.lua │ │ │ ├── init.lua │ │ │ └── efm-general-ls.lua │ │ ├── theming.lua │ │ ├── .undodir │ │ │ └── %home%yash%.dotfiles%config%nvim%lua%plugins.lua │ │ ├── options.lua │ │ ├── plugins.lua │ │ └── keymaps.lua │ ├── ftdetect │ │ └── prisma.vim │ ├── .undodir │ │ ├── %home%yash%.dotfiles%config%nvim%init.lua │ │ └── %home%yash%.dotfiles%config%nvim%lua%plugins.lua │ ├── init.lua │ ├── after │ │ └── plugin │ │ │ └── barbar.vim │ └── plugin │ │ └── packer_compiled.vim ├── polybar │ ├── hack │ │ ├── scripts │ │ │ ├── launcher.sh │ │ │ ├── rofi │ │ │ │ ├── colors.rasi │ │ │ │ ├── confirm.rasi │ │ │ │ ├── message.rasi │ │ │ │ ├── launcher.rasi │ │ │ │ ├── powermenu.rasi │ │ │ │ ├── styles.rasi │ │ │ │ └── networkmenu.rasi │ │ │ ├── check-network │ │ │ ├── pywal.sh │ │ │ ├── updates.sh │ │ │ ├── random.sh │ │ │ ├── colors-dark.sh │ │ │ ├── colors-light.sh │ │ │ ├── powermenu.sh │ │ │ ├── color-switch.sh │ │ │ └── checkupdates │ │ ├── preview.sh │ │ ├── launch.sh │ │ ├── colors.ini │ │ ├── user_modules.ini │ │ ├── config.ini │ │ ├── preview.ini │ │ └── bars.ini │ └── launch.sh ├── i3 │ └── config └── alacritty │ └── alacritty.yml ├── home ├── .npmrc ├── .xinitrc └── .zshrc ├── configure.sh ├── LICENSE ├── README.md ├── @ └── windows └── settings.json /.gitignore: -------------------------------------------------------------------------------- 1 | .undodir/ 2 | -------------------------------------------------------------------------------- /config/nvim/.gitignore: -------------------------------------------------------------------------------- 1 | .undodir/ 2 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/vim-rooter/init.lua: -------------------------------------------------------------------------------- 1 | vim.g.rooter_silent_chdir = 1 2 | -------------------------------------------------------------------------------- /config/nvim/ftdetect/prisma.vim: -------------------------------------------------------------------------------- 1 | au BufRead,BufNewFile *.prisma set filetype=prisma 2 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/bookmarks/init.lua: -------------------------------------------------------------------------------- 1 | vim.g.bookmark_no_default_key_mappings = 1 2 | vim.g.bookmark_sign = '' 3 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/lspsaga/init.lua: -------------------------------------------------------------------------------- 1 | local saga = require 'lspsaga' 2 | 3 | saga.init_lsp_saga {code_action_icon = ''} 4 | 5 | -------------------------------------------------------------------------------- /config/nvim/lua/lsp/python.lua: -------------------------------------------------------------------------------- 1 | -- npm i -g pyright 2 | require'lspconfig'.pyright.setup { 3 | on_attach = require'lsp'.common_on_attach, 4 | } 5 | -------------------------------------------------------------------------------- /config/nvim/lua/lsp/graphql.lua: -------------------------------------------------------------------------------- 1 | -- npm install -g graphql-language-service-cli 2 | require'lspconfig'.graphql.setup {on_attach = require'lsp'.common_on_attach} 3 | -------------------------------------------------------------------------------- /config/nvim/lua/lsp/css.lua: -------------------------------------------------------------------------------- 1 | -- npm install -g vscode-css-languageserver-bin 2 | require'lspconfig'.cssls.setup { 3 | on_attach = require'lsp'.common_on_attach 4 | } 5 | -------------------------------------------------------------------------------- /config/nvim/.undodir/%home%yash%.dotfiles%config%nvim%init.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyabits/dotfiles/HEAD/config/nvim/.undodir/%home%yash%.dotfiles%config%nvim%init.lua -------------------------------------------------------------------------------- /config/nvim/lua/plugins/hop/init.lua: -------------------------------------------------------------------------------- 1 | vim.api.nvim_set_keymap('n', 's', ":HopChar2", {silent = true}) 2 | vim.api.nvim_set_keymap('n', 'S', ":HopWord", {silent = true}) 3 | -------------------------------------------------------------------------------- /config/polybar/hack/scripts/launcher.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | rofi -no-config -no-lazy-grab -show drun -modi drun -theme ~/.config/polybar/hack/scripts/rofi/launcher.rasi 4 | -------------------------------------------------------------------------------- /config/nvim/.undodir/%home%yash%.dotfiles%config%nvim%lua%plugins.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyabits/dotfiles/HEAD/config/nvim/.undodir/%home%yash%.dotfiles%config%nvim%lua%plugins.lua -------------------------------------------------------------------------------- /config/nvim/lua/theming.lua: -------------------------------------------------------------------------------- 1 | vim.cmd('set termguicolors') 2 | 3 | vim.cmd('syntax enable') 4 | vim.cmd('colorscheme nightfly') 5 | 6 | -- vim.cmd('hi Normal guibg=NONE ctermbg=NONE') 7 | 8 | -------------------------------------------------------------------------------- /config/nvim/lua/.undodir/%home%yash%.dotfiles%config%nvim%lua%plugins.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyabits/dotfiles/HEAD/config/nvim/lua/.undodir/%home%yash%.dotfiles%config%nvim%lua%plugins.lua -------------------------------------------------------------------------------- /config/nvim/lua/plugins/kommentary/init.lua: -------------------------------------------------------------------------------- 1 | vim.api.nvim_set_keymap("n", "", "kommentary_line_default", {}) 2 | vim.api.nvim_set_keymap("v", "", "kommentary_visual_default", {}) 3 | -------------------------------------------------------------------------------- /config/polybar/hack/scripts/rofi/colors.rasi: -------------------------------------------------------------------------------- 1 | /* colors */ 2 | 3 | * { 4 | al: #00000000; 5 | bg: #141C21FF; 6 | ac: #1e88e5FF; 7 | se: #1e88e526; 8 | fg: #FFFFFFFF; 9 | } 10 | -------------------------------------------------------------------------------- /config/nvim/lua/lsp/bash.lua: -------------------------------------------------------------------------------- 1 | -- npm i -g bash-language-server 2 | require'lspconfig'.bashls.setup { 3 | cmd = {DATA_PATH .. "/lspinstall/bash/node_modules/.bin/bash-language-server", "start"}, 4 | on_attach = require'lsp'.common_on_attach 5 | } 6 | -------------------------------------------------------------------------------- /home/.npmrc: -------------------------------------------------------------------------------- 1 | init-author-name=Yash Gupta 2 | init-author-email=yashguptaofficial@gmail.com 3 | init-license=MIT 4 | init-author-url=https://yashguptaz.com/ 5 | save-exact=true 6 | username=yashguptaz 7 | email=yashguptamic@gmail.com 8 | //registry.npmjs.org/: 9 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/toggleterm/init.lua: -------------------------------------------------------------------------------- 1 | require"toggleterm".setup{ 2 | size = 20, 3 | open_mapping = [[]], 4 | shade_filetypes = {}, 5 | shade_terminals = true, 6 | shading_factor = '1', 7 | start_in_insert = true, 8 | persist_size = true, 9 | direction = 'vertical' | 'horizontal', 10 | } 11 | -------------------------------------------------------------------------------- /config/nvim/lua/lsp/html.lua: -------------------------------------------------------------------------------- 1 | -- npm install -g vscode-html-languageserver-bin 2 | local capabilities = vim.lsp.protocol.make_client_capabilities() 3 | capabilities.textDocument.completion.completionItem.snippetSupport = true 4 | 5 | require'lspconfig'.html.setup {on_attach = require'lsp'.common_on_attach, capabilities = capabilities} 6 | -------------------------------------------------------------------------------- /config/nvim/lua/lsp/json.lua: -------------------------------------------------------------------------------- 1 | -- npm install -g vscode-json-languageserver 2 | require'lspconfig'.jsonls.setup { 3 | on_attach = require'lsp'.common_on_attach, 4 | commands = { 5 | Format = { 6 | function() 7 | vim.lsp.buf.range_formatting({},{0,0},{vim.fn.line("$"),0}) 8 | end 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/floaterm/init.lua: -------------------------------------------------------------------------------- 1 | -- Floaterm 2 | vim.g.floaterm_keymap_toggle = '' 3 | vim.g.floaterm_keymap_next = '' 4 | vim.g.floaterm_keymap_prev = '' 5 | vim.g.floaterm_keymap_new = '' 6 | vim.g.floaterm_title='' 7 | 8 | vim.g.floaterm_gitcommit='floaterm' 9 | vim.g.floaterm_autoinsert=1 10 | vim.g.floaterm_width=0.8 11 | vim.g.floaterm_height=0.8 12 | vim.g.floaterm_wintitle=0 13 | vim.g.floaterm_autoclose=1 14 | -------------------------------------------------------------------------------- /config/polybar/hack/preview.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | DIR="$HOME/.config/polybar/hack" 4 | 5 | # Terminate already running bar instances 6 | killall -q polybar 7 | 8 | # Wait until the processes have been shut down 9 | while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done 10 | 11 | # Launch the preview bar 12 | polybar -q top -c "$DIR"/preview.ini & 13 | polybar -q mid -c "$DIR"/preview.ini & 14 | polybar -q bottom -c "$DIR"/preview.ini & 15 | -------------------------------------------------------------------------------- /config/polybar/hack/launch.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Add this script to your wm startup file. 4 | 5 | DIR="$HOME/.config/polybar/hack" 6 | 7 | # Terminate already running bar instances 8 | killall -q polybar 9 | 10 | # Wait until the processes have been shut down 11 | while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done 12 | 13 | # Launch the bar 14 | polybar -q top -c "$DIR"/config.ini & 15 | polybar -q bottom -c "$DIR"/config.ini & 16 | 17 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/closetag/init.lua: -------------------------------------------------------------------------------- 1 | -- Autoclose Tags -- 2 | vim.api.nvim_set_var('closetag_filenames', '*.html,*.xhtml,*.phtml, *.jsx, *.js, *.tsx') 3 | vim.api.nvim_set_var('closetag_xhtml_filenames', '*.xhtml,*.jsx, *.tsx, *.js') 4 | vim.api.nvim_set_var('closetag_filetypes', 'html,xhtml,phtml') 5 | vim.api.nvim_set_var('closetag_xhtml_filetypes', 'xhtml,jsx') 6 | vim.api.nvim_set_var('closetag_emptyTags_caseSensitive', 1) 7 | vim.api.nvim_set_var('closetag_shortcut', '>') 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /config/nvim/lua/lsp/ts.lua: -------------------------------------------------------------------------------- 1 | -- npm install -g typescript typescript-language-server 2 | -- require'snippets'.use_suggested_mappings() 3 | -- local capabilities = vim.lsp.protocol.make_client_capabilities() 4 | -- capabilities.textDocument.completion.completionItem.snippetSupport = true; 5 | -- local on_attach_common = function(client) 6 | -- print("LSP Initialized") 7 | -- require'completion'.on_attach(client) 8 | -- require'illuminate'.on_attach(client) 9 | -- end 10 | require'lspconfig'.tsserver.setup { 11 | settings = {documentFormatting = false} 12 | } 13 | -------------------------------------------------------------------------------- /config/polybar/hack/scripts/rofi/confirm.rasi: -------------------------------------------------------------------------------- 1 | /* Confirm Dialog */ 2 | 3 | @import "colors.rasi" 4 | 5 | * { 6 | background-color: @bg; 7 | text-color: @fg; 8 | font: "Iosevka Nerd Font 10"; 9 | } 10 | 11 | window { 12 | width: 225px; 13 | padding: 25px; 14 | border: 1px; 15 | border-radius: 0px; 16 | border-color: @ac; 17 | location: center; 18 | y-offset: -2em; 19 | } 20 | 21 | entry { 22 | expand: true; 23 | text-color: @ac; 24 | } 25 | -------------------------------------------------------------------------------- /config/polybar/hack/scripts/rofi/message.rasi: -------------------------------------------------------------------------------- 1 | /* Confirm Dialog */ 2 | 3 | @import "colors.rasi" 4 | 5 | * { 6 | background-color: @bg; 7 | text-color: @fg; 8 | font: "Iosevka Nerd Font 10"; 9 | } 10 | 11 | window { 12 | width: 320px; 13 | padding: 25px; 14 | border: 1px; 15 | border-radius: 0px; 16 | border-color: @ac; 17 | location: center; 18 | y-offset: -2em; 19 | } 20 | 21 | entry { 22 | expand: true; 23 | text-color: @ac; 24 | } 25 | -------------------------------------------------------------------------------- /config/polybar/hack/scripts/check-network: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | count=0 4 | connected="說" 5 | disconnected="ﲁ" 6 | 7 | ID="$(ip link | awk '/state UP/ {print $2}')" 8 | 9 | while true; do 10 | if (ping -c 1 archlinux.org || ping -c 1 google.com || ping -c 1 bitbucket.org || ping -c 1 github.com || ping -c 1 sourceforge.net) &>/dev/null; then 11 | if [[ $ID == e* ]]; then 12 | echo "$connected Online" ; sleep 25 13 | else 14 | echo "$connected Online" ; sleep 25 15 | fi 16 | else 17 | echo "$disconnected Offline" ; sleep 5 18 | fi 19 | done 20 | -------------------------------------------------------------------------------- /config/nvim/lua/lsp/prisma.lua: -------------------------------------------------------------------------------- 1 | -- TODO: Figure out why this is not working! 2 | local lspconfig = require'lspconfig' 3 | local configs = require'lspconfig/configs' 4 | -- Check if it's already defined for when reloading this file. 5 | if not lspconfig.prisma_lsp then 6 | configs.prisma_lsp = { 7 | default_config = { 8 | cmd = {'prisma-language-server', '--stdio'}; 9 | filetypes = {'prisma'}; 10 | root_dir = function(fname) 11 | return lspconfig.util.root_pattern(".git")(fname); 12 | end; 13 | settings = {}; 14 | }; 15 | } 16 | end 17 | 18 | lspconfig.prisma_lsp.setup{} 19 | -------------------------------------------------------------------------------- /config/nvim/lua/lsp/emmet.lua: -------------------------------------------------------------------------------- 1 | local nvim_lsp = require'lspconfig' 2 | local configs = require'lspconfig/configs' 3 | local capabilities = vim.lsp.protocol.make_client_capabilities() 4 | capabilities.textDocument.completion.completionItem.snippetSupport = true 5 | 6 | configs.emmet_ls = { 7 | default_config = { 8 | cmd = {'emmet-ls', '--stdio'}; 9 | filetypes = {'html', 'css', "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx"}; 10 | root_dir = function() 11 | return vim.loop.cwd() 12 | end; 13 | settings = {}; 14 | }; 15 | } 16 | 17 | nvim_lsp.emmet_ls.setup{ 18 | on_attach = on_attach; 19 | } 20 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/lspkind/init.lua: -------------------------------------------------------------------------------- 1 | -- symbols for autocomplete 2 | require('lspkind').init({ 3 | with_text = false, 4 | symbol_map = { 5 | Text = '  ', 6 | Method = '  ', 7 | Function = '  ', 8 | Constructor = '  ', 9 | Variable = '[]', 10 | Class = '  ', 11 | Interface = ' 蘒', 12 | Module = '  ', 13 | Property = '  ', 14 | Unit = ' 塞 ', 15 | Value = '  ', 16 | Enum = ' 練', 17 | Keyword = '  ', 18 | Snippet = '  ', 19 | Color = '', 20 | File = '', 21 | Folder = ' ﱮ ', 22 | EnumMember = '  ', 23 | Constant = '  ', 24 | Struct = '  ' 25 | }, 26 | }) 27 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/indentline/init.lua: -------------------------------------------------------------------------------- 1 | vim.g.indent_blankline_buftype_exclude = {'terminal'} 2 | vim.g.indent_blankline_filetype_exclude = {'help', 'startify', 'dashboard', 'packer', 'neogitstatus'} 3 | vim.g.indent_blankline_char = '▏' 4 | vim.g.indent_blankline_use_treesitter = true 5 | vim.g.indent_blankline_show_trailing_blankline_indent = false 6 | vim.g.indent_blankline_show_current_context = true 7 | vim.g.indent_blankline_context_patterns = { 8 | 'class', 'return', 'function', 'method', '^if', '^while', 'jsx_element', '^for', '^object', '^table', 'block', 9 | 'arguments', 'if_statement', 'else_clause', 'jsx_element', 'jsx_self_closing_element', 'try_statement', 10 | 'catch_clause', 'import_statement', 'operation_type' 11 | } 12 | -------------------------------------------------------------------------------- /config/polybar/hack/colors.ini: -------------------------------------------------------------------------------- 1 | ;; ┌────────────────────────────────────────────────────────────┐ 2 | ;; │░█▀█░█▀█░█░░░█░█░█▀▄░█▀█░█▀▄░░░░░░░░░█▀▀░█▀█░█░░░█▀█░█▀▄░█▀▀│ 3 | ;; │░█▀▀░█░█░█░░░░█░░█▀▄░█▀█░█▀▄░░░░▀░░░░█░░░█░█░█░░░█░█░█▀▄░▀▀█│ 4 | ;; │░▀░░░▀▀▀░▀▀▀░░▀░░▀▀░░▀░▀░▀░▀░░░░▀░░░░▀▀▀░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀▀▀│ 5 | ;; │░Created░By░Aditya░Shakya░@adi1090x░░░░░░░░░░░░░░░░░░░░░░░░░│ 6 | ;; └────────────────────────────────────────────────────────────┘ 7 | 8 | ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ 9 | 10 | [color] 11 | 12 | ;; Use pywal.sh in scripts directory to use colors from an image/wallpaper. 13 | 14 | ;; main colors 15 | background = #141C21 16 | foreground = #FFFFFF 17 | primary = #1e88e5 18 | red = #FF5250 19 | green = #43a047 20 | yellow = #fdd835 21 | 22 | ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ 23 | -------------------------------------------------------------------------------- /configure.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Check if a file or folder already exists 3 | # If it exists move it to folder/filename.old 4 | function moveToOld () 5 | { 6 | 7 | } 8 | 9 | cd home/ 10 | 11 | echo Symlinking Configuration files to Home ... 12 | HOME_FILES=($(ls -a)) 13 | 14 | # Remove the First 2 items from the array 15 | unset HOME_FILES[0] # Remove "." 16 | unset HOME_FILES[1] # Remove ".." 17 | 18 | for i in "${HOME_FILES[@]}"; do 19 | echo "$i" 20 | echo "ln -s $i ~/$i" 21 | done 22 | 23 | # Symlink from config folder 24 | echo Symlinking Configuration files to ~/.config ... 25 | cd ../config/ 26 | 27 | CONFIG_FOLDERS=($(ls -a)) 28 | # Remove the First 2 items from the array 29 | unset CONFIG_FOLDERS[0] # Remove "." 30 | unset CONFIG_FOLDERS[1] # Remove ".." 31 | 32 | for i in "${CONFIG_FOLDERS[@]}"; do 33 | echo "$i" 34 | echo "ln -s $i ~/.config/$i" 35 | done 36 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/treesitter/init.lua: -------------------------------------------------------------------------------- 1 | require'nvim-treesitter.configs'.setup { 2 | ensure_installed = "all", 3 | highlight = { 4 | enable = true -- false will disable the whole extension 5 | }, 6 | -- indent = {enable = true, disable = {"python", "html", "javascript"}}, 7 | indent = {enable = true}, 8 | playground = { 9 | enable = true, 10 | disable = {}, 11 | updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code 12 | persist_queries = false -- Whether the query persists across vim sessions 13 | }, 14 | autotag = {enable = true}, 15 | rainbow = {enable = true}, 16 | context_commentstring = {enable = true, config = {javascriptreact = {style_element = '{/*%s*/}'}}}, 17 | refactor = { 18 | highlight_definitions = { enable = true }, 19 | highlight_current_scope = { enable = true } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/emmet/init.lua: -------------------------------------------------------------------------------- 1 | -- After you have what you want press C-Y and , at the same time 2 | -- autocmd FileType html,css EmmetInstall 3 | -- vim.g.user_emmet_leader_key='' 4 | vim.g.user_emmet_mode='inv' 5 | vim.g.user_emmet_expandabbr_key = ',' 6 | vim.g.user_emmet_expandword_key = ';' 7 | vim.g.user_emmet_update_tag = 'u' 8 | vim.g.user_emmet_balancetaginward_key = 'd' 9 | vim.g.user_emmet_balancetagoutward_key = 'D' 10 | vim.g.user_emmet_next_key = 'n' 11 | vim.g.user_emmet_prev_key = 'N' 12 | vim.g.user_emmet_imagesize_key = 'i' 13 | vim.g.user_emmet_togglecomment_key = '/' 14 | vim.g.user_emmet_splitjointag_key = 'j' 15 | vim.g.user_emmet_removetag_key = 'k' 16 | vim.g.user_emmet_anchorizeurl_key = 'a' 17 | vim.g.user_emmet_anchorizesummary_key = 'A' 18 | vim.g.user_emmet_mergelines_key = 'm' 19 | vim.g.user_emmet_codepretty_key = 'c' 20 | -------------------------------------------------------------------------------- /config/nvim/lua/lsp/lua-ls.lua: -------------------------------------------------------------------------------- 1 | require'lspconfig'.sumneko_lua.setup { 2 | cmd = {"lua-language-server", "-E", "/usr/share/lua-language-server/main.lua"}; 3 | settings = { 4 | Lua = { 5 | runtime = { 6 | -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) 7 | version = 'LuaJIT', 8 | -- Setup your lua path 9 | path = vim.split(package.path, ';') 10 | }, 11 | diagnostics = { 12 | -- Get the language server to recognize the `vim` global 13 | globals = {'vim'} 14 | }, 15 | workspace = { 16 | -- Make the server aware of Neovim runtime files 17 | library = {[vim.fn.expand('$VIMRUNTIME/lua')] = true, [vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true} 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /config/nvim/init.lua: -------------------------------------------------------------------------------- 1 | require('options') 2 | require('plugins') 3 | require('keymaps') 4 | require('theming') 5 | 6 | -- Plugins 7 | require('plugins/nvim-compe') 8 | require('plugins/telescope') 9 | require('plugins/nvim-tree') 10 | require('plugins/kommentary') 11 | require('plugins/dashboard') 12 | require('plugins/galaxyline') 13 | require('plugins/lspkind') 14 | require('plugins/lightbulb') 15 | require('plugins/emmet') 16 | require('plugins/vim-rooter') 17 | require('plugins/floaterm') 18 | require('plugins/bookmarks') 19 | require('plugins/indentline') 20 | require('plugins/closetag') 21 | require('plugins/autopairs') 22 | require('plugins/hop') 23 | 24 | -- Language Servers 25 | require('lsp/init') 26 | require('lsp/ts') 27 | require('lsp/json') 28 | require('lsp/graphql') 29 | require('lsp/efm-general-ls') 30 | require('lsp/css') 31 | require('lsp/html') 32 | require('lsp/prisma') 33 | require('lsp/python') 34 | require('lsp/lua-ls') 35 | -- Get Prisma LSP Working 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Yash 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /config/polybar/hack/scripts/pywal.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Color files 4 | PFILE="$HOME/.config/polybar/hack/colors.ini" 5 | RFILE="$HOME/.config/polybar/hack/scripts/rofi/colors.rasi" 6 | 7 | # Get colors 8 | pywal_get() { 9 | wal -i "$1" -q -t 10 | } 11 | 12 | # Change colors 13 | change_color() { 14 | # polybar 15 | sed -i -e "s/background = #.*/background = $BG/g" $PFILE 16 | sed -i -e "s/foreground = #.*/foreground = $FG/g" $PFILE 17 | sed -i -e "s/primary = #.*/primary = $AC/g" $PFILE 18 | 19 | # rofi 20 | cat > $RFILE <<- EOF 21 | /* colors */ 22 | 23 | * { 24 | al: #00000000; 25 | bg: ${BG}FF; 26 | ac: ${AC}FF; 27 | se: ${AC}26; 28 | fg: ${FG}FF; 29 | } 30 | EOF 31 | 32 | polybar-msg cmd restart 33 | } 34 | 35 | # Main 36 | if [[ -f "/usr/bin/wal" ]]; then 37 | if [[ "$1" ]]; then 38 | pywal_get "$1" 39 | 40 | # Source the pywal color file 41 | . "$HOME/.cache/wal/colors.sh" 42 | 43 | BG=`printf "%s\n" "$background"` 44 | FG=`printf "%s\n" "$foreground"` 45 | AC=`printf "%s\n" "$color1"` 46 | 47 | change_color 48 | else 49 | echo -e "[!] Please enter the path to wallpaper. \n" 50 | echo "Usage : ./pywal.sh path/to/image" 51 | fi 52 | else 53 | echo "[!] 'pywal' is not installed." 54 | fi 55 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/dashboard/init.lua: -------------------------------------------------------------------------------- 1 | vim.g.dashboard_custom_header = { 2 | '███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗', 3 | '████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║', 4 | '██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║', 5 | '██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║', 6 | '██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║', 7 | '╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝' 8 | } 9 | 10 | vim.g.dashboard_custom_section = { 11 | a = {description = {' Find File '}, command = 'Telescope find_files'}, 12 | b = {description = {' Recently Used Files'}, command = 'Telescope oldfiles'}, 13 | c = {description = {' Load Last Session '}, command = 'SessionLoad'}, 14 | d = {description = {' Find Word '}, command = 'Telescope live_grep'}, 15 | e = {description = {' Marks '}, command = 'Telescope marks'} 16 | } 17 | 18 | -- file_browser = {description = {' File Browser'}, command = 'Telescope find_files'}, 19 | 20 | -- vim.g.dashboard_custom_shortcut = { 21 | -- a = 'f', 22 | -- find_word = 'SPC f a', 23 | -- last_session = 'SPC s l', 24 | -- new_file = 'SPC c n', 25 | -- book_marks = 'SPC f b' 26 | -- } 27 | -- find_history = 'SPC f h', 28 | 29 | -- vim.g.dashboard_session_directory = '~/.cache/nvim/session' 30 | vim.g.dashboard_custom_footer = { 31 | '   既 ', 32 | '@yashguptaz' 33 | } 34 | -------------------------------------------------------------------------------- /config/nvim/after/plugin/barbar.vim: -------------------------------------------------------------------------------- 1 | let s:currentTab = '#0b2942' 2 | let s:white = '#c3ccdc' 3 | let s:inactiveTab = '#01111d' 4 | let s:inactiveTabFg = '#5b7a93' 5 | 6 | let s:grey_blue = '#7c8f8f' 7 | let s:cadet_blue = '#a1aab8' 8 | 9 | let s:none = 'NONE' 10 | let s:tabFill = '#011627' 11 | 12 | exe 'hi BufferCurrent guibg=' . s:currentTab . ' guifg=' . s:white 13 | exe 'hi BufferInactive guibg=' . s:inactiveTab . ' guifg=' . s:inactiveTabFg 14 | 15 | exe 'hi BufferCurrentMod guibg=' . s:currentTab . ' guifg=' . s:white 16 | exe 'hi BufferVisibleMod guibg=' . s:inactiveTab . ' guifg=' . s:inactiveTabFg 17 | 18 | exe 'hi BufferTabpageFill guibg=' . s:tabFill . ' guifg=' . s:none 19 | exe 'hi BufferInactiveSign guibg=' . s:none . ' guifg=' . s:cadet_blue 20 | 21 | " barbar.nvim plugin 22 | " exec 'highlight BufferCurrentSign guibg=' . s:dark_blue . ' guifg=' . s:blue 23 | " exec 'highlight BufferVisible guibg=' . s:dark_blue . ' guifg=' . s:grey_blue 24 | " exec 'highlight BufferVisibleMod guibg=' . s:dark_blue . ' guifg=' . s:tan 25 | " exec 'highlight BufferVisibleSign guibg=' . s:dark_blue . ' guifg=' . s:grey_blue 26 | " exec 'highlight BufferInactive guibg=' . s:slate_blue . ' guifg=' . s:grey_blue 27 | " exec 'highlight BufferInactiveMod guibg=' . s:slate_blue . ' guifg=' . s:tan 28 | " exec 'highlight BufferInactiveSign guibg=' . s:slate_blue . ' guifg=' . s:cadet_blue 29 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/lightbulb/init.lua: -------------------------------------------------------------------------------- 1 | -- Showing defaults 2 | require'nvim-lightbulb'.update_lightbulb { 3 | sign = { 4 | enabled = true, 5 | -- Priority of the gutter sign 6 | priority = 10, 7 | text = "💡", 8 | }, 9 | float = { 10 | enabled = false, 11 | -- Text to show in the popup float 12 | text = "💡", 13 | -- Available keys for window options: 14 | -- - height of floating window 15 | -- - width of floating window 16 | -- - wrap_at character to wrap at for computing height 17 | -- - max_width maximal width of floating window 18 | -- - max_height maximal height of floating window 19 | -- - pad_left number of columns to pad contents at left 20 | -- - pad_right number of columns to pad contents at right 21 | -- - pad_top number of lines to pad contents at top 22 | -- - pad_bottom number of lines to pad contents at bottom 23 | -- - offset_x x-axis offset of the floating window 24 | -- - offset_y y-axis offset of the floating window 25 | -- - anchor corner of float to place at the cursor (NW, NE, SW, SE) 26 | -- - winblend transparency of the window (0-100) 27 | win_opts = {}, 28 | }, 29 | virtual_text = { 30 | enabled = false, 31 | -- Text to show at virtual text 32 | text = "💡", 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /config/polybar/hack/scripts/updates.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | NOTIFY_ICON=/usr/share/icons/Papirus/32x32/apps/system-software-update.svg 4 | 5 | get_total_updates() { UPDATES=$(checkupdates 2>/dev/null | wc -l); } 6 | 7 | while true; do 8 | get_total_updates 9 | 10 | # notify user of updates 11 | if hash notify-send &>/dev/null; then 12 | if (( UPDATES > 50 )); then 13 | notify-send -u critical -i $NOTIFY_ICON \ 14 | "You really need to update!!" "$UPDATES New packages" 15 | elif (( UPDATES > 25 )); then 16 | notify-send -u normal -i $NOTIFY_ICON \ 17 | "You should update soon" "$UPDATES New packages" 18 | elif (( UPDATES > 2 )); then 19 | notify-send -u low -i $NOTIFY_ICON \ 20 | "$UPDATES New packages" 21 | fi 22 | fi 23 | 24 | # when there are updates available 25 | # every 10 seconds another check for updates is done 26 | while (( UPDATES > 0 )); do 27 | if (( UPDATES == 1 )); then 28 | echo " $UPDATES" 29 | elif (( UPDATES > 1 )); then 30 | echo " $UPDATES" 31 | else 32 | echo " None" 33 | fi 34 | sleep 10 35 | get_total_updates 36 | done 37 | 38 | # when no updates are available, use a longer loop, this saves on CPU 39 | # and network uptime, only checking once every 30 min for new updates 40 | while (( UPDATES == 0 )); do 41 | echo " None" 42 | sleep 1800 43 | get_total_updates 44 | done 45 | done 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Author: [@yashguptaz](https://twitter.com/yashguptaz) 2 | 3 | A script for setting up all the symlinks for all the config is in progress. 4 | If you're interested then take a look at, 5 | 6 | `configure.sh` 7 | 8 | Make sure to run `chmod +x ./configure.sh` 9 | and then you can run the script by simply doing `./configure.sh` 10 | 11 | # Quick Start 12 | 13 | 1. Clone this repo 14 | `git clone https://github.com/yashguptaz/dotfiles-and-config.git ~/.dotfiles` 15 | 2. `cp -a ~/.dotfiles/home ~/` 16 | 3. `cp -a ~/.dotfiles/config/ ~/.config/` 17 | 4. Install all the programs 18 | 19 | ## Zsh and OhMyZsh 20 | 21 | https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH 22 | 23 | https://github.com/ohmyzsh/ohmyzsh 24 | 25 | ## Neovim 26 | 27 | 1. Install Neovim (0.5+ which is the nightly version as of writing) 28 | 2. Install vim plug https://github.com/junegunn/vim-plug 29 | 3. Open `~/.config/nvim/init.vim` 30 | 4. Run `:so %` in neovim to source the `init.vim` file 31 | 5. Run `:PlugInstall` in neovim to install all the plugins 32 | 33 | ## Node and NPM 34 | 35 | 1. Use https://github.com/Schniz/fnm to install Fast Node Manager 36 | 37 | ## i3wm, X utilities and autotiling 38 | 39 | i3wm 40 | 41 | ```bash 42 | sudo pacman -S i3-gaps i3status i3lock dmenu # Arch 43 | 44 | sudo apt install i3-gaps i3status i3lock dmenu # Ubuntu 45 | ``` 46 | 47 | 48 | 49 | X Utilities 50 | 51 | ```bash 52 | sudo pacman -S xorg-xset xorg-xrandr # Arch 53 | 54 | sudo apt install xorg-xset xorg-xrandr # Ubuntu 55 | ``` 56 | 57 | 58 | 59 | autotiling 60 | 61 | ```bash 62 | yay -S autotiling # AUR only 63 | ``` 64 | 65 | 66 | 67 | ## Alacritty 68 | 69 | ```bash 70 | sudo pacman -S alacritty 71 | 72 | sudo apt install alacritty 73 | ``` 74 | 75 | ## Polybar 76 | 77 | https://github.com/adi1090x/polybar-themes -------------------------------------------------------------------------------- /home/.xinitrc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # ~/.xinitrc 4 | # 5 | # Executed by startx (run your window manager from here) 6 | 7 | userresources=$HOME/.Xresources 8 | usermodmap=$HOME/.Xmodmap 9 | sysresources=/etc/X11/xinit/.Xresources 10 | sysmodmap=/etc/X11/xinit/.Xmodmap 11 | 12 | exec dbus-launch i3 13 | DEFAULT_SESSION='i3 --shmlog-size 0' 14 | 15 | # merge in defaults and keymaps 16 | 17 | if [ -f $sysresources ]; then 18 | xrdb -merge $sysresources 19 | fi 20 | 21 | if [ -f $sysmodmap ]; then 22 | xmodmap $sysmodmap 23 | fi 24 | 25 | if [ -f "$userresources" ]; then 26 | xrdb -merge "$userresources" 27 | fi 28 | 29 | if [ -f "$usermodmap" ]; then 30 | xmodmap "$usermodmap" 31 | fi 32 | 33 | # start some nice programs 34 | 35 | if [ -d /etc/X11/xinit/xinitrc.d ] ; then 36 | for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do 37 | [ -x "$f" ] && . "$f" 38 | done 39 | unset f 40 | fi 41 | 42 | get_session(){ 43 | local dbus_args=(--sh-syntax --exit-with-session) 44 | case $1 in 45 | awesome) dbus_args+=(awesome) ;; 46 | bspwm) dbus_args+=(bspwm-session) ;; 47 | budgie) dbus_args+=(budgie-desktop) ;; 48 | cinnamon) dbus_args+=(cinnamon-session) ;; 49 | deepin) dbus_args+=(startdde) ;; 50 | enlightenment) dbus_args+=(enlightenment_start) ;; 51 | fluxbox) dbus_args+=(startfluxbox) ;; 52 | gnome) dbus_args+=(gnome-session) ;; 53 | i3|i3wm) dbus_args+=(i3 --shmlog-size 0) ;; 54 | jwm) dbus_args+=(jwm) ;; 55 | kde) dbus_args+=(startkde) ;; 56 | lxde) dbus_args+=(startlxde) ;; 57 | lxqt) dbus_args+=(lxqt-session) ;; 58 | mate) dbus_args+=(mate-session) ;; 59 | xfce) dbus_args+=(xfce4-session) ;; 60 | openbox) dbus_args+=(openbox-session) ;; 61 | *) dbus_args+=($DEFAULT_SESSION) ;; 62 | esac 63 | 64 | echo "dbus-launch ${dbus_args[*]}" 65 | } 66 | 67 | exec $(get_session) 68 | -------------------------------------------------------------------------------- /config/polybar/launch.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | dir="$HOME/.config/polybar" 4 | themes=(`ls --hide="launch.sh" $dir`) 5 | 6 | launch_bar() { 7 | # Terminate already running bar instances 8 | killall -q polybar 9 | 10 | # Wait until the processes have been shut down 11 | while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done 12 | 13 | # Launch the bar 14 | if [[ "$style" == "hack" || "$style" == "cuts" ]]; then 15 | polybar -q top -c "$dir/$style/config.ini" & 16 | polybar -q bottom -c "$dir/$style/config.ini" & 17 | elif [[ "$style" == "pwidgets" ]]; then 18 | bash "$dir"/pwidgets/launch.sh --main 19 | else 20 | polybar -q main -c "$dir/$style/config.ini" & 21 | fi 22 | } 23 | 24 | if [[ "$1" == "--material" ]]; then 25 | style="material" 26 | launch_bar 27 | 28 | elif [[ "$1" == "--shades" ]]; then 29 | style="shades" 30 | launch_bar 31 | 32 | elif [[ "$1" == "--hack" ]]; then 33 | style="hack" 34 | launch_bar 35 | 36 | elif [[ "$1" == "--docky" ]]; then 37 | style="docky" 38 | launch_bar 39 | 40 | elif [[ "$1" == "--cuts" ]]; then 41 | style="cuts" 42 | launch_bar 43 | 44 | elif [[ "$1" == "--shapes" ]]; then 45 | style="shapes" 46 | launch_bar 47 | 48 | elif [[ "$1" == "--grayblocks" ]]; then 49 | style="grayblocks" 50 | launch_bar 51 | 52 | elif [[ "$1" == "--blocks" ]]; then 53 | style="blocks" 54 | launch_bar 55 | 56 | elif [[ "$1" == "--colorblocks" ]]; then 57 | style="colorblocks" 58 | launch_bar 59 | 60 | elif [[ "$1" == "--forest" ]]; then 61 | style="forest" 62 | launch_bar 63 | 64 | elif [[ "$1" == "--pwidgets" ]]; then 65 | style="pwidgets" 66 | launch_bar 67 | 68 | elif [[ "$1" == "--panels" ]]; then 69 | style="panels" 70 | launch_bar 71 | 72 | else 73 | cat <<- EOF 74 | Usage : launch.sh --theme 75 | 76 | Available Themes : 77 | --blocks --colorblocks --cuts --docky 78 | --forest --grayblocks --hack --material 79 | --panels --pwidgets --shades --shapes 80 | EOF 81 | fi 82 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/nvim-tree/init.lua: -------------------------------------------------------------------------------- 1 | vim.g.nvim_tree_follow = 1 -- 0 by default, this option allows the cursor to be updated when entering a buffer 2 | 3 | local tree_cb = require'nvim-tree.config'.nvim_tree_callback 4 | vim.g.nvim_tree_bindings = { 5 | -- mappings 6 | [""] = tree_cb("edit"), 7 | ["l"] = tree_cb("edit"), 8 | ["o"] = tree_cb("edit"), 9 | ["<2-LeftMouse>"] = tree_cb("edit"), 10 | ["<2-RightMouse>"] = tree_cb("cd"), 11 | [""] = tree_cb("cd"), 12 | ["v"] = tree_cb("vsplit"), 13 | ["s"] = tree_cb("split"), 14 | [""] = tree_cb("tabnew"), 15 | ["h"] = tree_cb("close_node"), 16 | [""] = tree_cb("close_node"), 17 | [""] = tree_cb("close_node"), 18 | [""] = tree_cb("preview"), 19 | ["I"] = tree_cb("toggle_ignored"), 20 | ["H"] = tree_cb("toggle_dotfiles"), 21 | ["R"] = tree_cb("refresh"), 22 | ["a"] = tree_cb("create"), 23 | ["d"] = tree_cb("remove"), 24 | ["r"] = tree_cb("rename"), 25 | [""] = tree_cb("full_rename"), 26 | ["x"] = tree_cb("cut"), 27 | ["c"] = tree_cb("copy"), 28 | ["p"] = tree_cb("paste"), 29 | ["[c"] = tree_cb("prev_git_item"), 30 | ["]c"] = tree_cb("next_git_item"), 31 | ["-"] = tree_cb("dir_up"), 32 | ["q"] = tree_cb("close"), 33 | } 34 | 35 | 36 | vim.g.nvim_tree_icons = { 37 | default= '', 38 | symlink= '', 39 | git= { 40 | unstaged= "✗", 41 | staged= "✓", 42 | unmerged= "", 43 | renamed= "➜", 44 | untracked= "★", 45 | deleted= "" 46 | }, 47 | folder = { 48 | default= "", 49 | open= "", 50 | empty= "", 51 | empty_open= "", 52 | symlink= "", 53 | symlink_open= "", 54 | } 55 | } 56 | 57 | -------------------------------------------------------------------------------- /config/nvim/lua/lsp/init.lua: -------------------------------------------------------------------------------- 1 | vim.fn.sign_define("LspDiagnosticsSignError", 2 | {texthl = "LspDiagnosticsSignError", text = "", numhl = "LspDiagnosticsSignError"}) 3 | vim.fn.sign_define("LspDiagnosticsSignWarning", 4 | {texthl = "LspDiagnosticsSignWarning", text = "", numhl = "LspDiagnosticsSignWarning"}) 5 | vim.fn.sign_define("LspDiagnosticsSignInformation", 6 | {texthl = "LspDiagnosticsSignInformation", text = "", numhl = "LspDiagnosticsSignInformation"}) 7 | vim.fn.sign_define("LspDiagnosticsSignHint", 8 | {texthl = "LspDiagnosticsSignHint", text = "", numhl = "LspDiagnosticsSignHint"}) 9 | 10 | local function documentHighlight(client, bufnr) 11 | -- Set autocommands conditional on server_capabilities 12 | if client.resolved_capabilities.document_highlight then 13 | vim.api.nvim_exec([[ 14 | hi LspReferenceRead cterm=bold ctermbg=red guibg=#464646 15 | hi LspReferenceText cterm=bold ctermbg=red guibg=#464646 16 | hi LspReferenceWrite cterm=bold ctermbg=red guibg=#464646 17 | augroup lsp_document_highlight 18 | autocmd! * 19 | autocmd CursorHold lua vim.lsp.buf.document_highlight() 20 | autocmd CursorMoved lua vim.lsp.buf.clear_references() 21 | augroup END 22 | ]], false) 23 | 24 | end 25 | end 26 | 27 | local lsp_config = {} 28 | 29 | function lsp_config.common_on_attach(client, bufnr) 30 | documentHighlight(client, bufnr) 31 | end 32 | 33 | function lsp_config.tsserver_on_attach(client, bufnr) 34 | lsp_config.common_on_attach(client, bufnr) 35 | client.resolved_capabilities.document_formatting = false 36 | end 37 | 38 | -- Use a loop to conveniently both setup defined servers 39 | -- and map buffer local keybindings when the language server attaches 40 | -- local servers = {"pyright", "tsserver"} 41 | -- for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup {on_attach = on_attach} end 42 | return lsp_config 43 | 44 | -------------------------------------------------------------------------------- /config/polybar/hack/scripts/random.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Color files 4 | PFILE="$HOME/.config/polybar/hack/colors.ini" 5 | RFILE="$HOME/.config/polybar/hack/scripts/rofi/colors.rasi" 6 | 7 | # Change colors 8 | change_color() { 9 | # polybar 10 | sed -i -e "s/background = #.*/background = $BG/g" $PFILE 11 | sed -i -e "s/foreground = #.*/foreground = $FG/g" $PFILE 12 | sed -i -e "s/primary = #.*/primary = $AC/g" $PFILE 13 | 14 | # rofi 15 | cat > $RFILE <<- EOF 16 | /* colors */ 17 | 18 | * { 19 | al: #00000000; 20 | bg: #1F1F1FFF; 21 | ac: ${AC}FF; 22 | se: ${AC}26; 23 | fg: #FFFFFFFF; 24 | } 25 | EOF 26 | 27 | polybar-msg cmd restart 28 | } 29 | 30 | get_random_number() { 31 | RNUM=$(( ($RANDOM % $1) + 1 )) 32 | } 33 | 34 | get_random_color() { 35 | RCOLOR="#" 36 | for i in 1 2 3 4 5 6 37 | do 38 | get_random_number "16" 39 | case $RNUM in 40 | "1") NEXTDIGIT="1";; 41 | "2") NEXTDIGIT="2";; 42 | "3") NEXTDIGIT="3";; 43 | "4") NEXTDIGIT="4";; 44 | "5") NEXTDIGIT="5";; 45 | "6") NEXTDIGIT="6";; 46 | "7") NEXTDIGIT="7";; 47 | "8") NEXTDIGIT="8";; 48 | "9") NEXTDIGIT="9";; 49 | "10") NEXTDIGIT="A";; 50 | "11") NEXTDIGIT="B";; 51 | "12") NEXTDIGIT="C";; 52 | "13") NEXTDIGIT="D";; 53 | "14") NEXTDIGIT="E";; 54 | "15") NEXTDIGIT="F";; 55 | "16") NEXTDIGIT="0";; 56 | esac 57 | RCOLOR="$RCOLOR$NEXTDIGIT" 58 | done 59 | echo $RCOLOR 60 | } 61 | 62 | hex_to_rgb() { 63 | # Convert a hex value WITHOUT the hashtag (#) 64 | R=$(printf "%d" 0x${1:0:2}) 65 | G=$(printf "%d" 0x${1:2:2}) 66 | B=$(printf "%d" 0x${1:4:2}) 67 | } 68 | 69 | get_fg_color(){ 70 | INTENSITY=$(calc "$R*0.299 + $G*0.587 + $B*0.114") 71 | 72 | if [ $(echo "$INTENSITY>186" | bc) -eq 1 ]; then 73 | FG="#0a0a0a" 74 | else 75 | FG="#F5F5F5" 76 | fi 77 | } 78 | 79 | # Main 80 | BG='#1f1f1f' # change to light bg 81 | FG='#FFFFFF' # change to dark fg 82 | AC=`get_random_color` 83 | 84 | #BG=`get_random_color` 85 | #HEX=${BG:1} 86 | #hex_to_rgb $HEX 87 | #get_fg_color 88 | 89 | change_color 90 | -------------------------------------------------------------------------------- /config/polybar/hack/scripts/colors-dark.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Color files 4 | PFILE="$HOME/.config/polybar/hack/colors.ini" 5 | RFILE="$HOME/.config/polybar/hack/scripts/rofi/colors.rasi" 6 | 7 | # Change colors 8 | change_color() { 9 | # polybar 10 | sed -i -e 's/background = #.*/background = #141C21/g' $PFILE 11 | sed -i -e 's/foreground = #.*/foreground = #FFFFFF/g' $PFILE 12 | sed -i -e "s/primary = #.*/primary = $AC/g" $PFILE 13 | 14 | # rofi 15 | cat > $RFILE <<- EOF 16 | /* colors */ 17 | 18 | * { 19 | al: #00000000; 20 | bg: #141C21FF; 21 | ac: ${AC}FF; 22 | se: ${AC}26; 23 | fg: #FFFFFFFF; 24 | } 25 | EOF 26 | 27 | polybar-msg cmd restart 28 | } 29 | 30 | if [[ $1 = "--amber" ]]; then 31 | AC="#ffb300" 32 | change_color 33 | elif [[ $1 = "--blue" ]]; then 34 | AC="#1e88e5" 35 | change_color 36 | elif [[ $1 = "--blue-gray" ]]; then 37 | AC="#546e7a" 38 | change_color 39 | elif [[ $1 = "--brown" ]]; then 40 | AC="#6d4c41" 41 | change_color 42 | elif [[ $1 = "--cyan" ]]; then 43 | AC="#00acc1" 44 | change_color 45 | elif [[ $1 = "--deep-orange" ]]; then 46 | AC="#f4511e" 47 | change_color 48 | elif [[ $1 = "--deep-purple" ]]; then 49 | AC="#5e35b1" 50 | change_color 51 | elif [[ $1 = "--green" ]]; then 52 | AC="#43a047" 53 | change_color 54 | elif [[ $1 = "--gray" ]]; then 55 | AC="#757575" 56 | change_color 57 | elif [[ $1 = "--indigo" ]]; then 58 | AC="#3949ab" 59 | change_color 60 | elif [[ $1 = "--light-blue" ]]; then 61 | AC="#039be5" 62 | change_color 63 | elif [[ $1 = "--light-green" ]]; then 64 | AC="#7cb342" 65 | change_color 66 | elif [[ $1 = "--lime" ]]; then 67 | AC="#c0ca33" 68 | change_color 69 | elif [[ $1 = "--orange" ]]; then 70 | AC="#fb8c00" 71 | change_color 72 | elif [[ $1 = "--pink" ]]; then 73 | AC="#d81b60" 74 | change_color 75 | elif [[ $1 = "--purple" ]]; then 76 | AC="#8e24aa" 77 | change_color 78 | elif [[ $1 = "--red" ]]; then 79 | AC="#e53935" 80 | change_color 81 | elif [[ $1 = "--teal" ]]; then 82 | AC="#00897b" 83 | change_color 84 | elif [[ $1 = "--yellow" ]]; then 85 | AC="#fdd835" 86 | change_color 87 | else 88 | cat <<- _EOF_ 89 | No option specified, Available options: 90 | --amber --blue --blue-gray --brown 91 | --cyan --deep-orange --deep-purple --green 92 | --gray --indigo --light-blue --light-green 93 | --lime --orange --pink --purple 94 | --red --teal --yellow 95 | _EOF_ 96 | fi 97 | -------------------------------------------------------------------------------- /config/polybar/hack/scripts/colors-light.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Color files 4 | PFILE="$HOME/.config/polybar/hack/colors.ini" 5 | RFILE="$HOME/.config/polybar/hack/scripts/rofi/colors.rasi" 6 | 7 | # Change colors 8 | change_color() { 9 | # polybar 10 | sed -i -e 's/background = #.*/background = #FFFFFF/g' $PFILE 11 | sed -i -e 's/foreground = #.*/foreground = #1F1F1F/g' $PFILE 12 | sed -i -e "s/primary = #.*/primary = $AC/g" $PFILE 13 | 14 | # rofi 15 | cat > $RFILE <<- EOF 16 | /* colors */ 17 | 18 | * { 19 | al: #00000000; 20 | bg: #FFFFFFFF; 21 | ac: ${AC}FF; 22 | se: ${AC}26; 23 | fg: #1F1F1FFF; 24 | } 25 | EOF 26 | 27 | polybar-msg cmd restart 28 | } 29 | 30 | if [[ $1 = "--amber" ]]; then 31 | AC="#ffb300" 32 | change_color 33 | elif [[ $1 = "--blue" ]]; then 34 | AC="#1e88e5" 35 | change_color 36 | elif [[ $1 = "--blue-gray" ]]; then 37 | AC="#546e7a" 38 | change_color 39 | elif [[ $1 = "--brown" ]]; then 40 | AC="#6d4c41" 41 | change_color 42 | elif [[ $1 = "--cyan" ]]; then 43 | AC="#00acc1" 44 | change_color 45 | elif [[ $1 = "--deep-orange" ]]; then 46 | AC="#f4511e" 47 | change_color 48 | elif [[ $1 = "--deep-purple" ]]; then 49 | AC="#5e35b1" 50 | change_color 51 | elif [[ $1 = "--green" ]]; then 52 | AC="#43a047" 53 | change_color 54 | elif [[ $1 = "--gray" ]]; then 55 | AC="#757575" 56 | change_color 57 | elif [[ $1 = "--indigo" ]]; then 58 | AC="#3949ab" 59 | change_color 60 | elif [[ $1 = "--light-blue" ]]; then 61 | AC="#039be5" 62 | change_color 63 | elif [[ $1 = "--light-green" ]]; then 64 | AC="#7cb342" 65 | change_color 66 | elif [[ $1 = "--lime" ]]; then 67 | AC="#c0ca33" 68 | change_color 69 | elif [[ $1 = "--orange" ]]; then 70 | AC="#fb8c00" 71 | change_color 72 | elif [[ $1 = "--pink" ]]; then 73 | AC="#d81b60" 74 | change_color 75 | elif [[ $1 = "--purple" ]]; then 76 | AC="#8e24aa" 77 | change_color 78 | elif [[ $1 = "--red" ]]; then 79 | AC="#e53935" 80 | change_color 81 | elif [[ $1 = "--teal" ]]; then 82 | AC="#00897b" 83 | change_color 84 | elif [[ $1 = "--yellow" ]]; then 85 | AC="#fdd835" 86 | change_color 87 | else 88 | cat <<- _EOF_ 89 | No option specified, Available options: 90 | --amber --blue --blue-gray --brown 91 | --cyan --deep-orange --deep-purple --green 92 | --gray --indigo --light-blue --light-green 93 | --lime --orange --pink --purple 94 | --red --teal --yellow 95 | _EOF_ 96 | fi 97 | -------------------------------------------------------------------------------- /config/polybar/hack/scripts/powermenu.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ## Author : Aditya Shakya 4 | ## Mail : adi1090x@gmail.com 5 | ## Github : @adi1090x 6 | ## Twitter : @adi1090x 7 | 8 | dir="~/.config/polybar/hack/scripts/rofi" 9 | uptime=$(uptime -p | sed -e 's/up //g') 10 | 11 | rofi_command="rofi -theme $dir/powermenu.rasi" 12 | 13 | # Options 14 | shutdown=" Shutdown" 15 | reboot=" Restart" 16 | lock=" Lock" 17 | suspend=" Sleep" 18 | logout=" Logout" 19 | 20 | # Confirmation 21 | confirm_exit() { 22 | rofi -dmenu\ 23 | -i\ 24 | -no-fixed-num-lines\ 25 | -p "Are You Sure? : "\ 26 | -theme $dir/confirm.rasi 27 | } 28 | 29 | # Message 30 | msg() { 31 | rofi -theme "$dir/message.rasi" -e "Available Options - yes / y / no / n" 32 | } 33 | 34 | # Variable passed to rofi 35 | options="$lock\n$suspend\n$logout\n$reboot\n$shutdown" 36 | 37 | chosen="$(echo -e "$options" | $rofi_command -p "Uptime: $uptime" -dmenu -selected-row 0)" 38 | case $chosen in 39 | $shutdown) 40 | ans=$(confirm_exit &) 41 | if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then 42 | systemctl poweroff 43 | elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then 44 | exit 0 45 | else 46 | msg 47 | fi 48 | ;; 49 | $reboot) 50 | ans=$(confirm_exit &) 51 | if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then 52 | systemctl reboot 53 | elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then 54 | exit 0 55 | else 56 | msg 57 | fi 58 | ;; 59 | $lock) 60 | if [[ -f /usr/bin/i3lock ]]; then 61 | i3lock 62 | elif [[ -f /usr/bin/betterlockscreen ]]; then 63 | betterlockscreen -l 64 | fi 65 | ;; 66 | $suspend) 67 | ans=$(confirm_exit &) 68 | if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then 69 | mpc -q pause 70 | amixer set Master mute 71 | systemctl suspend 72 | elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then 73 | exit 0 74 | else 75 | msg 76 | fi 77 | ;; 78 | $logout) 79 | ans=$(confirm_exit &) 80 | if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then 81 | if [[ "$DESKTOP_SESSION" == "Openbox" ]]; then 82 | openbox --exit 83 | elif [[ "$DESKTOP_SESSION" == "bspwm" ]]; then 84 | bspc quit 85 | elif [[ "$DESKTOP_SESSION" == "i3" ]]; then 86 | i3-msg exit 87 | fi 88 | elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then 89 | exit 0 90 | else 91 | msg 92 | fi 93 | ;; 94 | esac 95 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/autopairs/init.lua: -------------------------------------------------------------------------------- 1 | require('nvim-autopairs').setup() 2 | local npairs = require('nvim-autopairs') 3 | 4 | local function imap(lhs, rhs, opts) 5 | local options = {noremap = false} 6 | if opts then options = vim.tbl_extend('force', options, opts) end 7 | vim.api.nvim_set_keymap('i', lhs, rhs, options) 8 | end 9 | 10 | _G.MUtils = {} 11 | 12 | -- TEST 13 | vim.g.completion_confirm_key = "" 14 | MUtils.completion_confirm = function() 15 | if vim.fn.pumvisible() ~= 0 then 16 | if vim.fn.complete_info()["selected"] ~= -1 then 17 | vim.fn["compe#confirm"]() 18 | -- return npairs.esc("") 19 | return npairs.esc("") 20 | else 21 | vim.defer_fn(function() 22 | vim.fn["compe#confirm"]("") 23 | end, 20) 24 | return npairs.esc("") 25 | end 26 | else 27 | return npairs.check_break_line_char() 28 | end 29 | end 30 | -- TEST 31 | 32 | MUtils.completion_confirm = function() 33 | if vim.fn.pumvisible() ~= 0 then 34 | if vim.fn.complete_info()["selected"] ~= -1 then 35 | vim.fn["compe#confirm"]() 36 | return npairs.esc("") 37 | else 38 | vim.api.nvim_select_popupmenu_item(0, false, false, {}) 39 | vim.fn["compe#confirm"]() 40 | return npairs.esc("") 41 | end 42 | else 43 | return npairs.check_break_line_char() 44 | end 45 | end 46 | 47 | MUtils.tab = function() 48 | if vim.fn.pumvisible() ~= 0 then 49 | return npairs.esc("") 50 | else 51 | if vim.fn["vsnip#available"](1) ~= 0 then 52 | vim.fn.feedkeys(string.format('%c%c%c(vsnip-expand-or-jump)', 0x80, 253, 83)) 53 | return npairs.esc("") 54 | else 55 | return npairs.esc("") 56 | end 57 | end 58 | end 59 | 60 | MUtils.s_tab = function() 61 | if vim.fn.pumvisible() ~= 0 then 62 | return npairs.esc("") 63 | else 64 | if vim.fn["vsnip#jumpable"](-1) ~= 0 then 65 | vim.fn.feedkeys(string.format('%c%c%c(vsnip-jump-prev)', 0x80, 253, 83)) 66 | return npairs.esc("") 67 | else 68 | return npairs.esc("") 69 | end 70 | end 71 | end 72 | 73 | -- Autocompletion and snippets 74 | vim.api.nvim_set_keymap('i', '', 'v:lua.MUtils.completion_confirm()', {expr = true, noremap = true}) 75 | -- imap("", "v:lua.MUtils.completion_confirm()", {expr = true, noremap = true}) 76 | imap("", "v:lua.MUtils.tab()", {expr = true, noremap = true}) 77 | imap("", "v:lua.MUtils.s_tab()", {expr = true, noremap = true}) 78 | 79 | 80 | -------------------------------------------------------------------------------- /config/polybar/hack/scripts/color-switch.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | SDIR="$HOME/.config/polybar/hack/scripts" 4 | 5 | # Launch Rofi 6 | MENU="$(rofi -no-config -no-lazy-grab -sep "|" -dmenu -i -p '' \ 7 | -theme $SDIR/rofi/styles.rasi \ 8 | <<< "♥ amber|♥ blue|♥ blue-gray|♥ brown|♥ cyan|♥ deep-orange|\ 9 | ♥ deep-purple|♥ green|♥ gray|♥ indigo|♥ blue-light|♥ green-light|\ 10 | ♥ lime|♥ orange|♥ pink|♥ purple|♥ red|♥ teal|♥ yellow|♥ amber-dark|\ 11 | ♥ blue-dark|♥ blue-gray-dark|♥ brown-dark|♥ cyan-dark|♥ deep-orange-dark|\ 12 | ♥ deep-purple-dark|♥ green-dark|♥ gray-dark|♥ indigo-dark|♥ blue-light-dark|\ 13 | ♥ green-light-dark|♥ lime-dark|♥ orange-dark|♥ pink-dark|♥ purple-dark|♥ red-dark|♥ teal-dark|♥ yellow-dark|")" 14 | case "$MENU" in 15 | ## Light Colors 16 | *amber) "$SDIR"/colors-light.sh --amber ;; 17 | *blue) "$SDIR"/colors-light.sh --blue ;; 18 | *blue-gray) "$SDIR"/colors-light.sh --blue-gray ;; 19 | *brown) "$SDIR"/colors-light.sh --brown ;; 20 | *cyan) "$SDIR"/colors-light.sh --cyan ;; 21 | *deep-orange) "$SDIR"/colors-light.sh --deep-orange ;; 22 | *deep-purple) "$SDIR"/colors-light.sh --deep-purple ;; 23 | *green) "$SDIR"/colors-light.sh --green ;; 24 | *gray) "$SDIR"/colors-light.sh --gray ;; 25 | *indigo) "$SDIR"/colors-light.sh --indigo ;; 26 | *blue-light) "$SDIR"/colors-light.sh --light-blue ;; 27 | *green-light) "$SDIR"/colors-light.sh --light-green ;; 28 | *lime) "$SDIR"/colors-light.sh --lime ;; 29 | *orange) "$SDIR"/colors-light.sh --orange ;; 30 | *pink) "$SDIR"/colors-light.sh --pink ;; 31 | *purple) "$SDIR"/colors-light.sh --purple ;; 32 | *red) "$SDIR"/colors-light.sh --red ;; 33 | *teal) "$SDIR"/colors-light.sh --teal ;; 34 | *yellow) "$SDIR"/colors-light.sh --yellow ;; 35 | ## Dark Colors 36 | *amber-dark) "$SDIR"/colors-dark.sh --amber ;; 37 | *blue-dark) "$SDIR"/colors-dark.sh --blue ;; 38 | *blue-gray-dark) "$SDIR"/colors-dark.sh --blue-gray ;; 39 | *brown-dark) "$SDIR"/colors-dark.sh --brown ;; 40 | *cyan-dark) "$SDIR"/colors-dark.sh --cyan ;; 41 | *deep-orange-dark) "$SDIR"/colors-dark.sh --deep-orange ;; 42 | *deep-purple-dark) "$SDIR"/colors-dark.sh --deep-purple ;; 43 | *green-dark) "$SDIR"/colors-dark.sh --green ;; 44 | *gray-dark) "$SDIR"/colors-dark.sh --gray ;; 45 | *indigo-dark) "$SDIR"/colors-dark.sh --indigo ;; 46 | *blue-light-dark) "$SDIR"/colors-dark.sh --light-blue ;; 47 | *green-light-dark) "$SDIR"/colors-dark.sh --light-green ;; 48 | *lime-dark) "$SDIR"/colors-dark.sh --lime ;; 49 | *orange-dark) "$SDIR"/colors-dark.sh --orange ;; 50 | *pink-dark) "$SDIR"/colors-dark.sh --pink ;; 51 | *purple-dark) "$SDIR"/colors-dark.sh --purple ;; 52 | *red-dark) "$SDIR"/colors-dark.sh --red ;; 53 | *teal-dark) "$SDIR"/colors-dark.sh --teal ;; 54 | *yellow-dark) "$SDIR"/colors-dark.sh --yellow 55 | esac 56 | -------------------------------------------------------------------------------- /config/nvim/lua/lsp/efm-general-ls.lua: -------------------------------------------------------------------------------- 1 | -- Example configuations here: https://github.com/mattn/efm-langserver 2 | -- python 3 | local flake8 = { 4 | LintCommand = "flake8 --ignore=E501 --stdin-display-name ${INPUT} -", 5 | lintStdin = true, 6 | lintFormats = {"%f:%l:%c: %m"} 7 | } 8 | local isort = {formatCommand = "isort --quiet -", formatStdin = true} 9 | local yapf = {formatCommand = "yapf --quiet", formatStdin = true} 10 | -- lua 11 | local luaFormat = { 12 | formatCommand = "lua-format -i --no-keep-simple-function-one-line --column-limit=120", 13 | formatStdin = true 14 | } 15 | -- JavaScript/React/TypeScript 16 | local prettier = {formatCommand = "prettier --stdin-filepath ${INPUT}", formatStdin = true} 17 | 18 | local prettier_global = {formatCommand = "prettier --stdin-filepath ${INPUT}", formatStdin = true} 19 | 20 | local eslint = { 21 | lintCommand = "eslint -f unix --stdin --stdin-filename ${INPUT}", 22 | lintIgnoreExitCode = true, 23 | lintStdin = true, 24 | lintFormats = {"%f:%l:%c: %m"}, 25 | formatCommand = "eslint --fix-to-stdout --stdin --stdin-filename=${INPUT}", 26 | formatStdin = true 27 | } 28 | 29 | local shellcheck = { 30 | LintCommand = 'shellcheck -f gcc -x', 31 | lintFormats = {'%f:%l:%c: %trror: %m', '%f:%l:%c: %tarning: %m', '%f:%l:%c: %tote: %m'} 32 | } 33 | 34 | local shfmt = {formatCommand = 'shfmt -ci -s -bn', formatStdin = true} 35 | 36 | local markdownlint = { 37 | -- TODO default to global lintrc 38 | -- lintcommand = 'markdownlint -s -c ./markdownlintrc', 39 | lintCommand = 'markdownlint -s', 40 | lintStdin = true, 41 | lintFormats = {'%f:%l %m', '%f:%l:%c %m', '%f: %l: %m'} 42 | } 43 | 44 | local markdownPandocFormat = {formatCommand = 'pandoc -f markdown -t gfm -sp --tab-stop=2', formatStdin = true} 45 | 46 | require"lspconfig".efm.setup { 47 | -- init_options = {initializationOptions}, 48 | init_options = {documentFormatting = true, codeAction = false}, 49 | filetypes = {"lua", "python", "javascriptreact", "javascript", "sh", "html", "css", "json", "yaml", "markdown"}, 50 | settings = { 51 | rootMarkers = {".git/"}, 52 | languages = { 53 | -- lua = {luaFormat}, 54 | python = {isort, yapf}, 55 | javascript = {prettier, eslint}, 56 | typescript = {prettier, eslint}, 57 | javascriptreact = {prettier, eslint}, 58 | typescriptreact = {prettier, eslint}, 59 | sh = {shellcheck, shfmt}, 60 | html = {prettier_global}, 61 | css = {prettier_global}, 62 | json = {prettier_global}, 63 | yaml = {prettier_global}, 64 | -- markdown = {markdownPandocFormat, markdownlint}, 65 | markdown = {markdownPandocFormat} 66 | } 67 | } 68 | } 69 | 70 | -- Automatically Run Prettier on Save 71 | -- vim.cmd("autocmd BufWritePre * lua vim.lsp.buf.formatting()") 72 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/nvim-compe/init.lua: -------------------------------------------------------------------------------- 1 | vim.o.completeopt = "menuone,noselect" 2 | 3 | require'compe'.setup { 4 | enabled = true, 5 | autocomplete = true, 6 | debug = false, 7 | min_length = 1, 8 | preselect = 'enable', 9 | throttle_time = 80, 10 | source_timeout = 200, 11 | incomplete_delay = 400, 12 | max_abbr_width = 100, 13 | max_kind_width = 100, 14 | max_menu_width = 100, 15 | documentation = true, 16 | 17 | source = { 18 | path = {kind = "  "}, 19 | buffer = {kind = "  "}, 20 | calc = {kind = "  "}, 21 | vsnip = {kind = "  "}, 22 | nvim_lsp = {kind = "  "}, 23 | -- nvim_lua = {kind = "  "}, 24 | nvim_lua = false, 25 | spell = {kind = "  "}, 26 | tags = false, 27 | -- snippets_nvim = {kind = "  "}, 28 | -- ultisnips = {kind = "  "}, 29 | -- treesitter = {kind = "  "}, 30 | emoji = {kind = " ﲃ ", filetypes={"markdown"}} 31 | -- for emoji press : (idk if that in compe tho) 32 | } 33 | } 34 | 35 | local t = function(str) 36 | return vim.api.nvim_replace_termcodes(str, true, true, true) 37 | end 38 | 39 | local check_back_space = function() 40 | local col = vim.fn.col('.') - 1 41 | if col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then 42 | return true 43 | else 44 | return false 45 | end 46 | end 47 | 48 | -- Use (s-)tab to: 49 | --- move to prev/next item in completion menuone 50 | --- jump to prev/next snippet's placeholder 51 | _G.tab_complete = function() 52 | if vim.fn.pumvisible() == 1 then 53 | return t "" 54 | elseif vim.fn.call("vsnip#available", {1}) == 1 then 55 | return t "(vsnip-expand-or-jump)" 56 | elseif check_back_space() then 57 | return t "" 58 | else 59 | return vim.fn['compe#complete']() 60 | end 61 | end 62 | _G.s_tab_complete = function() 63 | if vim.fn.pumvisible() == 1 then 64 | return t "" 65 | elseif vim.fn.call("vsnip#jumpable", {-1}) == 1 then 66 | return t "(vsnip-jump-prev)" 67 | else 68 | return t "" 69 | end 70 | end 71 | 72 | vim.api.nvim_set_keymap("i", "", "v:lua.tab_complete()", {expr = true}) 73 | vim.api.nvim_set_keymap("s", "", "v:lua.tab_complete()", {expr = true}) 74 | vim.api.nvim_set_keymap("i", "", "v:lua.s_tab_complete()", {expr = true}) 75 | vim.api.nvim_set_keymap("s", "", "v:lua.s_tab_complete()", {expr = true}) 76 | 77 | --[[ vim.cmd('inoremap compe#complete()') 78 | vim.cmd('inoremap compe#confirm(lexima#expand(\'CR>\', \'i\'))') 79 | vim.cmd('inoremap compe#close(\'\')') 80 | vim.cmd('inoremap compe#scroll({ \'delta\': +4 })') 81 | vim.cmd('inoremap compe#scroll({ \'delta\': -4 })') ]] 82 | -------------------------------------------------------------------------------- /config/nvim/lua/options.lua: -------------------------------------------------------------------------------- 1 | vim.wo.number = true -- set numbered lines 2 | vim.cmd('set relativenumber') -- Relative Line Numbers 3 | vim.cmd('set iskeyword+=-') -- treat dash separated words as a word text object" 4 | vim.cmd('set shortmess+=c') -- Don't pass messages to |ins-completion-menu|. 5 | vim.cmd('set noerrorbells') -- No Error Bells 6 | vim.cmd('set smartcase') -- Smartcase: in one uppercase char then search is case sensitive 7 | vim.cmd('set noswapfile') -- Noswapfile: in one uppercase char then search is case sensitive 8 | vim.cmd('set undofile') -- Persistent Undo 9 | vim.cmd('set incsearch') -- Incremental Search: Search as you type 10 | vim.cmd('set autoindent') -- Auto Indent 11 | vim.cmd('set nohlsearch') -- No Highlight Search 12 | vim.cmd('set nobackup') -- No no backup 13 | vim.cmd('set nowritebackup') -- No Write Backup 14 | vim.o.hidden = true -- Required to keep multiple buffers open 15 | vim.wo.wrap = true -- Display long lines as multiple 16 | vim.o.pumheight = 10 -- Makes popup menu smaller 17 | vim.o.scrolloff = 8 -- Scroll Offset of 8 lines 18 | vim.o.fileencoding = "utf-8" -- The encoding written to file 19 | vim.o.cmdheight = 2 -- More space for displaying messages 20 | vim.o.mouse = "a" -- Enable your mouse 21 | vim.o.backupcopy = "yes" -- Enable your mouse 22 | vim.o.splitbelow = true -- Horizontal splits will automatically be below 23 | vim.o.termguicolors = true -- set term giu colors most terminals support this 24 | vim.o.splitright = true -- Vertical splits will automatically be to the right 25 | vim.o.t_Co = "256" -- Support 256 colors 26 | vim.o.conceallevel = 0 -- So that I can see `` in markdown files 27 | vim.cmd('set ts=2') -- Insert 2 spaces for a tab 28 | vim.cmd('set sw=2') -- Change the number of space characters inserted for indentation 29 | vim.bo.smartindent = true -- Makes indenting smart 30 | vim.wo.cursorline = true -- Enable highlighting of the current line 31 | vim.o.showtabline = 2 -- Always show tabs 32 | vim.o.showmode = false -- We don't need to see things like -- INSERT -- anymore 33 | vim.o.backup = false -- This is recommended by coc 34 | vim.o.writebackup = false -- This is recommended by coc 35 | vim.wo.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time 36 | vim.o.updatetime = 300 -- Faster completion 37 | vim.o.timeoutlen = 100 -- By default timeoutlen is 1000 ms 38 | vim.o.clipboard = "unnamedplus" -- Copy paste between vim and everything else 39 | vim.cmd('set colorcolumn=99999') -- Fix Vim Indentline 40 | vim.o.shiftwidth = 2 41 | -- vim.bo.expandtab = true -- Converts tabs to spaces 42 | vim.cmd("filetype plugin on") -- Auto Indentation Levels 43 | vim.cmd("filetype indent off") -- Auto Indentation Levels 44 | 45 | vim.bo.copyindent = true 46 | vim.bo.shiftwidth = 4 47 | vim.bo.tabstop = 4 48 | vim.bo.softtabstop = 4 49 | vim.bo.autoindent = true 50 | vim.bo.smartindent = true 51 | -------------------------------------------------------------------------------- /@: -------------------------------------------------------------------------------- 1 | -- TODO figure out why this don't work 2 | vim.fn.sign_define("LspDiagnosticsSignError", 3 | {texthl = "LspDiagnosticsSignError", text = "", numhl = "LspDiagnosticsSignError"}) 4 | vim.fn.sign_define("LspDiagnosticsSignWarning", 5 | {texthl = "LspDiagnosticsSignWarning", text = "", numhl = "LspDiagnosticsSignWarning"}) 6 | vim.fn.sign_define("LspDiagnosticsSignInformation", 7 | {texthl = "LspDiagnosticsSignInformation", text = "", numhl = "LspDiagnosticsSignInformation"}) 8 | vim.fn.sign_define("LspDiagnosticsSignHint", 9 | {texthl = "LspDiagnosticsSignHint", text = "", numhl = "LspDiagnosticsSignHint"}) 10 | 11 | vim.cmd('nnoremap gd lua vim.lsp.buf.definition()') 12 | vim.cmd('nnoremap gD lua vim.lsp.buf.declaration()') 13 | vim.cmd('nnoremap gr lua vim.lsp.buf.references()') 14 | vim.cmd('nnoremap gi lua vim.lsp.buf.implementation()') 15 | vim.cmd('nnoremap ca :Lspsaga code_action') 16 | vim.cmd('nnoremap K :Lspsaga hover_doc') 17 | -- vim.cmd('nnoremap lua vim.lsp.buf.signature_help()') 18 | vim.cmd('nnoremap :Lspsaga diagnostic_jump_prev') 19 | vim.cmd('nnoremap :Lspsaga diagnostic_jump_next') 20 | -- scroll down hover doc or scroll in definition preview 21 | vim.cmd('command! -nargs=0 LspVirtualTextToggle lua require("lsp/virtual_text").toggle()') 22 | 23 | --[[ " autoformat 24 | autocmd BufWritePre *.js lua vim.lsp.buf.formatting_sync(nil, 100) 25 | autocmd BufWritePre *.jsx lua vim.lsp.buf.formatting_sync(nil, 100) 26 | autocmd BufWritePre *.lua lua vim.lsp.buf.formatting_sync(nil, 100) ]] 27 | -- Java 28 | -- autocmd FileType java nnoremap ca lua require('jdtls').code_action() 29 | 30 | local function documentHighlight(client, bufnr) 31 | -- Set autocommands conditional on server_capabilities 32 | if client.resolved_capabilities.document_highlight then 33 | vim.api.nvim_exec([[ 34 | hi LspReferenceRead cterm=bold ctermbg=red guibg=#464646 35 | hi LspReferenceText cterm=bold ctermbg=red guibg=#464646 36 | hi LspReferenceWrite cterm=bold ctermbg=red guibg=#464646 37 | augroup lsp_document_highlight 38 | autocmd! * 39 | autocmd CursorHold lua vim.lsp.buf.document_highlight() 40 | autocmd CursorMoved lua vim.lsp.buf.clear_references() 41 | augroup END 42 | ]], false) 43 | 44 | end 45 | 46 | end 47 | local lsp_config = {} 48 | 49 | function lsp_config.common_on_attach(client, bufnr) 50 | documentHighlight(client, bufnr) 51 | end 52 | 53 | function lsp_config.tsserver_on_attach(client, bufnr) 54 | lsp_config.common_on_attach(client, bufnr) 55 | client.resolved_capabilities.document_formatting = false 56 | end 57 | 58 | -- Use a loop to conveniently both setup defined servers 59 | -- and map buffer local keybindings when the language server attaches 60 | -- local servers = {"pyright", "tsserver"} 61 | -- for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup {on_attach = on_attach} end 62 | return lsp_config 63 | 64 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins.lua: -------------------------------------------------------------------------------- 1 | local execute = vim.api.nvim_command 2 | local fn = vim.fn 3 | 4 | local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' 5 | 6 | if fn.empty(fn.glob(install_path)) > 0 then 7 | execute('!git clone https://github.com/wbthomason/packer.nvim '..install_path) 8 | execute 'packadd packer.nvim' 9 | end 10 | -- This file can be loaded by calling `lua require('plugins')` from your init.vim 11 | 12 | return require('packer').startup(function() 13 | use 'wbthomason/packer.nvim' -- Packer can manage itself 14 | 15 | -- Appearence 16 | use 'bluz71/vim-nightfly-guicolors' -- Nightfly Color Theme 17 | use 'kyazdani42/nvim-tree.lua' -- Explorer 18 | use 'romgrk/barbar.nvim' -- VSCode like Tab Bar 19 | use {'glepnir/galaxyline.nvim' , branch = 'main'} 20 | use 'glepnir/dashboard-nvim' -- Dashboard for Neovim 21 | 22 | use 'kyazdani42/nvim-web-devicons' -- Devicons for Plugins 23 | use 'ryanoasis/vim-devicons' 24 | 25 | -- Web Dev 26 | use 'gennaro-tedesco/nvim-jqx' 27 | use 'alvan/vim-closetag' 28 | use 'styled-components/vim-styled-components' 29 | use 'jparise/vim-graphql' 30 | 31 | -- LSP 32 | use 'neovim/nvim-lspconfig' -- Language Server Protocol Config 33 | use 'glepnir/lspsaga.nvim' 34 | use 'onsails/lspkind-nvim' -- Better icons for autcomplete 35 | use 'kosayoda/nvim-lightbulb' 36 | use 'anott03/nvim-lspinstall' 37 | 38 | -- Autcomplete 39 | use 'hrsh7th/nvim-compe' -- Autocompletion 40 | use 'mattn/emmet-vim' 41 | use 'xabikos/vscode-javascript' 42 | use 'dsznajder/vscode-es7-javascript-react-snippets' 43 | use 'golang/vscode-go' 44 | use 'rust-lang/vscode-rust' 45 | -- use 'cohama/lexima.vim' 46 | 47 | -- Telescope 48 | use 'nvim-telescope/telescope.nvim' -- Telescope: Searching 49 | use 'akinsho/nvim-toggleterm.lua' -- Terminal for Neovim 50 | use 'nvim-lua/popup.nvim' -- Neovim Popup API 51 | use 'nvim-lua/plenary.nvim' -- Functions you don't wanna write again 52 | use 'nvim-telescope/telescope-media-files.nvim' 53 | 54 | -- Treesitter 55 | use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' } 56 | use 'nvim-treesitter/nvim-treesitter-refactor' 57 | use 'nvim-treesitter/playground' 58 | use 'p00f/nvim-ts-rainbow' 59 | use {'lukas-reineke/indent-blankline.nvim', branch = 'lua'} 60 | use 'romgrk/nvim-treesitter-context' 61 | 62 | 63 | -- Snippets 64 | use 'hrsh7th/vim-vsnip' -- Snipper Integration for Neovim 65 | use 'hrsh7th/vim-vsnip-integ' 66 | 67 | -- General 68 | use 'liuchengxu/vim-which-key' -- Which Key 69 | use 'kevinhwang91/nvim-bqf' 70 | use 'airblade/vim-rooter' 71 | use 'voldikss/vim-floaterm' 72 | use 'liuchengxu/vista.vim' 73 | use 'b3nj5m1n/kommentary' 74 | use 'bfredl/nvim-miniyank' 75 | use 'andymass/vim-matchup' -- Better % 76 | use 'MattesGroeger/vim-bookmarks' 77 | use { 'phaazon/hop.nvim', as = 'hop', } 78 | 79 | use 'TimUntersberger/neogit' -- Git integration for Neovim 80 | use 'mbbill/undotree' -- Undotree to undo stuff well 81 | use 'moll/vim-bbye' -- Better Tab Closing; Incompat. with Barbar 82 | use 'windwp/nvim-autopairs' 83 | 84 | -- Tool Specific 85 | use 'pantharshit00/vim-prisma' 86 | 87 | end) 88 | 89 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/telescope/init.lua: -------------------------------------------------------------------------------- 1 | local actions = require('telescope.actions') 2 | -- Global remapping 3 | ------------------------------ 4 | -- '--color=never', 5 | 6 | require('telescope').load_extension('media_files') 7 | require('telescope').setup { 8 | defaults = { 9 | vimgrep_arguments = {'rg', '--no-heading', '--with-filename', '--line-number', '--column', '--smart-case'}, 10 | prompt_position = "bottom", 11 | prompt_prefix = " ", 12 | selection_caret = " ", 13 | entry_prefix = " ", 14 | initial_mode = "insert", 15 | selection_strategy = "reset", 16 | sorting_strategy = "descending", 17 | layout_strategy = "horizontal", 18 | layout_defaults = {horizontal = {mirror = false}, vertical = {mirror = false}}, 19 | file_sorter = require'telescope.sorters'.get_fuzzy_file, 20 | file_ignore_patterns = {}, 21 | generic_sorter = require'telescope.sorters'.get_generic_fuzzy_sorter, 22 | shorten_path = true, 23 | winblend = 0, 24 | width = 0.75, 25 | preview_cutoff = 70, 26 | results_height = 1, 27 | results_width = 0.8, 28 | border = {}, 29 | borderchars = {'─', '│', '─', '│', '╭', '╮', '╯', '╰'}, 30 | color_devicons = true, 31 | use_less = true, 32 | set_env = {['COLORTERM'] = 'truecolor'}, -- default = nil, 33 | file_previewer = require'telescope.previewers'.vim_buffer_cat.new, 34 | grep_previewer = require'telescope.previewers'.vim_buffer_vimgrep.new, 35 | qflist_previewer = require'telescope.previewers'.vim_buffer_qflist.new, 36 | 37 | -- Developer configurations: Not meant for general override 38 | buffer_previewer_maker = require'telescope.previewers'.buffer_previewer_maker, 39 | mappings = { 40 | i = { 41 | [""] = actions.move_selection_next, 42 | [""] = actions.move_selection_previous, 43 | [""] = actions.send_to_qflist, 44 | -- To disable a keymap, put [map] = false 45 | -- So, to not map "", just put 46 | -- [""] = false, 47 | 48 | -- Otherwise, just set the mapping to the function that you want it to be. 49 | -- [""] = actions.select_horizontal, 50 | 51 | -- Add up multiple actions 52 | [""] = actions.select_default + actions.center 53 | 54 | -- You can perform as many actions in a row as you like 55 | -- [""] = actions.select_default + actions.center + my_cool_custom_action, 56 | }, 57 | n = { 58 | [""] = actions.move_selection_next, 59 | [""] = actions.move_selection_previous 60 | -- [""] = actions.close, 61 | -- [""] = my_cool_custom_action, 62 | } 63 | } 64 | }, 65 | require'telescope'.setup { 66 | extensions = { 67 | media_files = { 68 | -- filetypes whitelist 69 | -- defaults to {"png", "jpg", "mp4", "webm", "pdf"} 70 | filetypes = {"png", "webp", "jpg", "jpeg"}, 71 | find_cmd = "rg" -- find command (defaults to `fd`) 72 | } 73 | } 74 | } 75 | } 76 | 77 | local M = {} 78 | M.search_dotfiles = function() 79 | require("telescope.builtin").find_files({prompt_title = "< VimRC >", cwd = "~/.dotfiles/config/nvim"}) 80 | end 81 | 82 | M.search_garden = function() 83 | require("telescope.builtin").find_files({prompt_title = "< Garden >", cwd = "~/tech-garden"}) 84 | end 85 | 86 | return M 87 | 88 | -------------------------------------------------------------------------------- /config/polybar/hack/scripts/rofi/launcher.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "Iosevka Nerd Font 10"; 12 | show-icons: true; 13 | icon-theme: "Papirus"; 14 | display-drun: ""; 15 | drun-display-format: "{name}"; 16 | disable-history: false; 17 | fullscreen: false; 18 | hide-scrollbar: true; 19 | sidebar-mode: false; 20 | } 21 | 22 | @import "colors.rasi" 23 | 24 | window { 25 | transparency: "real"; 26 | background-color: @bg; 27 | text-color: @fg; 28 | border: 2px; 29 | border-color: @ac; 30 | border-radius: 0px; 31 | width: 450px; 32 | location: center; 33 | x-offset: 0; 34 | y-offset: 0; 35 | } 36 | 37 | prompt { 38 | enabled: true; 39 | padding: 10px; 40 | background-color: @al; 41 | text-color: @ac; 42 | font: "Iosevka Nerd Font 10"; 43 | } 44 | 45 | entry { 46 | background-color: @al; 47 | text-color: @ac; 48 | placeholder-color: @ac; 49 | expand: true; 50 | horizontal-align: 0; 51 | placeholder: "Search..."; 52 | padding: 10px 10px 10px 0px; 53 | border-radius: 0px; 54 | blink: true; 55 | } 56 | 57 | inputbar { 58 | children: [ prompt, entry ]; 59 | background-color: @al; 60 | text-color: @fg; 61 | expand: false; 62 | border: 0px 0px 1px 0px; 63 | border-radius: 0px; 64 | border-color: @ac; 65 | spacing: 0px; 66 | } 67 | 68 | listview { 69 | background-color: @al; 70 | padding: 0px; 71 | columns: 1; 72 | lines: 5; 73 | spacing: 5px; 74 | cycle: true; 75 | dynamic: true; 76 | layout: vertical; 77 | } 78 | 79 | mainbox { 80 | background-color: @al; 81 | border: 0px; 82 | border-radius: 0px; 83 | border-color: @ac; 84 | children: [ inputbar, listview ]; 85 | spacing: 10px; 86 | padding: 2px 10px 10px 10px; 87 | } 88 | 89 | element { 90 | background-color: @al; 91 | text-color: @fg; 92 | orientation: horizontal; 93 | border-radius: 0px; 94 | padding: 8px; 95 | } 96 | 97 | element-icon { 98 | size: 24px; 99 | border: 0px; 100 | } 101 | 102 | element-text { 103 | expand: true; 104 | horizontal-align: 0; 105 | vertical-align: 0.5; 106 | margin: 0px 2.5px 0px 2.5px; 107 | } 108 | 109 | element selected { 110 | background-color: @se; 111 | text-color: @fg; 112 | border: 0px 0px 0px 0px; 113 | border-radius: 0px; 114 | border-color: @ac; 115 | } 116 | -------------------------------------------------------------------------------- /config/polybar/hack/scripts/checkupdates: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | # 3 | # checkupdates: Safely print a list of pending updates. 4 | # 5 | # Copyright (c) 2013 Kyle Keen 6 | # 7 | # This program is free software; you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation; either version 2 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | # 20 | 21 | declare -r myname='checkupdates' 22 | declare -r myver='1.0.0' 23 | 24 | plain() { 25 | (( QUIET )) && return 26 | local mesg=$1; shift 27 | printf "${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&1 28 | } 29 | 30 | msg() { 31 | (( QUIET )) && return 32 | local mesg=$1; shift 33 | printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&1 34 | } 35 | 36 | msg2() { 37 | (( QUIET )) && return 38 | local mesg=$1; shift 39 | printf "${BLUE} ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&1 40 | } 41 | 42 | ask() { 43 | local mesg=$1; shift 44 | printf "${BLUE}::${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}" "$@" >&1 45 | } 46 | 47 | warning() { 48 | local mesg=$1; shift 49 | printf "${YELLOW}==> $(gettext "WARNING:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2 50 | } 51 | 52 | error() { 53 | local mesg=$1; shift 54 | printf "${RED}==> $(gettext "ERROR:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2 55 | } 56 | 57 | # check if messages are to be printed using color 58 | unset ALL_OFF BOLD BLUE GREEN RED YELLOW 59 | if [[ -t 2 && ! $USE_COLOR = "n" ]]; then 60 | # prefer terminal safe colored and bold text when tput is supported 61 | if tput setaf 0 &>/dev/null; then 62 | ALL_OFF="$(tput sgr0)" 63 | BOLD="$(tput bold)" 64 | BLUE="${BOLD}$(tput setaf 4)" 65 | GREEN="${BOLD}$(tput setaf 2)" 66 | RED="${BOLD}$(tput setaf 1)" 67 | YELLOW="${BOLD}$(tput setaf 3)" 68 | else 69 | ALL_OFF="\e[1;0m" 70 | BOLD="\e[1;1m" 71 | BLUE="${BOLD}\e[1;34m" 72 | GREEN="${BOLD}\e[1;32m" 73 | RED="${BOLD}\e[1;31m" 74 | YELLOW="${BOLD}\e[1;33m" 75 | fi 76 | fi 77 | readonly ALL_OFF BOLD BLUE GREEN RED YELLOW 78 | 79 | 80 | if (( $# > 0 )); then 81 | echo "${myname} v${myver}" 82 | echo 83 | echo "Safely print a list of pending updates" 84 | echo 85 | echo "Usage: ${myname}" 86 | echo 87 | echo 'Note: Export the "CHECKUPDATES_DB" variable to change the path of the temporary database.' 88 | exit 0 89 | fi 90 | 91 | if ! type -P fakeroot >/dev/null; then 92 | error 'Cannot find the fakeroot binary.' 93 | exit 1 94 | fi 95 | 96 | if [[ -z $CHECKUPDATES_DB ]]; then 97 | CHECKUPDATES_DB="${TMPDIR:-/tmp}/checkup-db-${USER}/" 98 | fi 99 | 100 | trap 'rm -f $CHECKUPDATES_DB/db.lck' INT TERM EXIT 101 | 102 | DBPath="$(pacman-conf DBPath)" 103 | if [[ -z "$DBPath" ]] || [[ ! -d "$DBPath" ]]; then 104 | DBPath="/var/lib/pacman/" 105 | fi 106 | 107 | mkdir -p "$CHECKUPDATES_DB" 108 | ln -s "${DBPath}/local" "$CHECKUPDATES_DB" &> /dev/null 109 | if ! fakeroot -- pacman -Sy --dbpath "$CHECKUPDATES_DB" --logfile /dev/null &> /dev/null; then 110 | error 'Cannot fetch updates' 111 | exit 1 112 | fi 113 | pacman -Qu --dbpath "$CHECKUPDATES_DB" 2> /dev/null | grep -v '\[.*\]' 114 | 115 | exit 0 116 | 117 | # vim: set noet: 118 | -------------------------------------------------------------------------------- /home/.zshrc: -------------------------------------------------------------------------------- 1 | # If you come from bash you might have to change your $PATH. 2 | # export PATH=$HOME/bin:/usr/local/bin:$PATH 3 | 4 | # Path to your oh-my-zsh installation. 5 | export ZSH="/home/yash/.oh-my-zsh" 6 | 7 | # Theme 8 | # https://github.com/ohmyzsh/ohmyzsh/wiki/Themes 9 | ZSH_THEME="avit" 10 | 11 | # Starship.rs 12 | eval "$(starship init zsh)" 13 | 14 | # fnm 15 | export PATH=/home/yash/.fnm$PATH 16 | # eval "$(fnm env)" 17 | 18 | # Configure fzf for fast search 19 | [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh 20 | 21 | # Directory Colors 22 | eval "$(dircolors -b)" 23 | 24 | # Plugins 25 | plugins=( 26 | git 27 | dotenv 28 | vi-mode 29 | zsh-autosuggestions 30 | docker 31 | autojump 32 | ) 33 | 34 | source $ZSH/oh-my-zsh.sh 35 | 36 | # Aliases 37 | alias ls="exa" 38 | alias vi="nvim" 39 | alias cat="bat" 40 | alias ps="procs" 41 | alias lzd="lazydocker" 42 | alias lzg="lazygit" 43 | # Brightness for Arch 44 | alias b+="blight set +20%" 45 | alias b-="blight set -20%" 46 | 47 | # Uncomment the following line to use case-sensitive completion. 48 | CASE_SENSITIVE="true" 49 | 50 | # fnm 51 | export PATH=/home/yash/.fnm:$PATH 52 | eval "`fnm env`" 53 | 54 | # DataGrip 55 | export PATH=/home/yash/apps/DataGrip-2020.3.2/bin$PATH 56 | 57 | # Uncomment the following line to use hyphen-insensitive completion. 58 | # Case-sensitive completion must be off. _ and - will be interchangeable. 59 | # HYPHEN_INSENSITIVE="true" 60 | 61 | # Uncomment the following line to disable bi-weekly auto-update checks. 62 | # DISABLE_AUTO_UPDATE="true" 63 | 64 | # Uncomment the following line to automatically update without prompting. 65 | # DISABLE_UPDATE_PROMPT="true" 66 | 67 | # Uncomment the following line to change how often to auto-update (in days). 68 | # export UPDATE_ZSH_DAYS=13 69 | 70 | # Uncomment the following line if pasting URLs and other text is messed up. 71 | # DISABLE_MAGIC_FUNCTIONS="true" 72 | 73 | # Uncomment the following line to disable colors in ls. 74 | # DISABLE_LS_COLORS="true" 75 | 76 | # Uncomment the following line to disable auto-setting terminal title. 77 | # DISABLE_AUTO_TITLE="true" 78 | 79 | # Uncomment the following line to enable command auto-correction. 80 | # ENABLE_CORRECTION="true" 81 | 82 | # Uncomment the following line to display red dots whilst waiting for completion. 83 | # Caution: this setting can cause issues with multiline prompts (zsh 5.7.1 and newer seem to work) 84 | # See https://github.com/ohmyzsh/ohmyzsh/issues/5765 85 | # COMPLETION_WAITING_DOTS="true" 86 | 87 | # Uncomment the following line if you want to disable marking untracked files 88 | # under VCS as dirty. This makes repository status check for large repositories 89 | # much, much faster. 90 | # DISABLE_UNTRACKED_FILES_DIRTY="true" 91 | 92 | # Uncomment the following line if you want to change the command execution time 93 | # stamp shown in the history command output. 94 | # You can set one of the optional three formats: 95 | # "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" 96 | # or set a custom format using the strftime function format specifications, 97 | # see 'man strftime' for details. 98 | # HIST_STAMPS="mm/dd/yyyy" 99 | 100 | # Would you like to use another custom folder than $ZSH/custom? 101 | # ZSH_CUSTOM=/path/to/new-custom-folder 102 | 103 | # User configuration 104 | 105 | # export MANPATH="/usr/local/man:$MANPATH" 106 | 107 | # You may need to manually set your language environment 108 | # export LANG=en_US.UTF-8 109 | 110 | # Preferred editor for local and remote sessions 111 | # if [[ -n $SSH_CONNECTION ]]; then 112 | # export EDITOR='vim' 113 | # else 114 | # export EDITOR='mvim' 115 | # fi 116 | 117 | # Compilation flags 118 | # export ARCHFLAGS="-arch x86_64" 119 | 120 | # fnm 121 | export PATH=/home/yash/.fnm:$PATH 122 | eval "`fnm env`" 123 | -------------------------------------------------------------------------------- /config/polybar/hack/scripts/rofi/powermenu.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "Iosevka Nerd Font 10"; 12 | show-icons: true; 13 | icon-theme: "Papirus"; 14 | display-drun: ""; 15 | drun-display-format: "{name}"; 16 | disable-history: false; 17 | fullscreen: false; 18 | hide-scrollbar: true; 19 | sidebar-mode: false; 20 | } 21 | 22 | @import "colors.rasi" 23 | 24 | window { 25 | transparency: "real"; 26 | background-color: @bg; 27 | text-color: @fg; 28 | border: 2px; 29 | border-color: @ac; 30 | border-radius: 0px; 31 | width: 300px; 32 | location: center; 33 | x-offset: 0; 34 | y-offset: 0; 35 | } 36 | 37 | prompt { 38 | enabled: true; 39 | padding: 10px 10px 10px 0px; 40 | background-color: @al; 41 | text-color: @ac; 42 | font: "Iosevka Nerd Font 10"; 43 | } 44 | 45 | textbox-prompt-colon { 46 | padding: 10px 15px 10px 15px; 47 | font: "Iosevka Nerd Font 10"; 48 | background-color: @al; 49 | text-color: @ac; 50 | expand: false; 51 | str: ""; 52 | } 53 | 54 | entry { 55 | background-color: @al; 56 | text-color: @ac; 57 | placeholder-color: @ac; 58 | expand: true; 59 | horizontal-align: 0; 60 | placeholder: "Search..."; 61 | padding: 10px 10px 10px 0px; 62 | border-radius: 0px; 63 | blink: true; 64 | } 65 | 66 | inputbar { 67 | children: [ textbox-prompt-colon, prompt ]; 68 | background-color: @al; 69 | text-color: @fg; 70 | expand: false; 71 | border: 0px 0px 1px 0px; 72 | border-radius: 0px; 73 | border-color: @ac; 74 | spacing: 0px; 75 | } 76 | 77 | listview { 78 | background-color: @al; 79 | padding: 0px; 80 | columns: 1; 81 | lines: 5; 82 | spacing: 5px; 83 | cycle: true; 84 | dynamic: true; 85 | layout: vertical; 86 | } 87 | 88 | mainbox { 89 | background-color: @al; 90 | border: 0px; 91 | border-radius: 0px; 92 | border-color: @ac; 93 | children: [ inputbar, listview ]; 94 | spacing: 10px; 95 | padding: 2px 10px 10px 10px; 96 | } 97 | 98 | element { 99 | background-color: @al; 100 | text-color: @fg; 101 | orientation: horizontal; 102 | border-radius: 0px; 103 | padding: 8px 8px 8px -16px; 104 | } 105 | 106 | element-icon { 107 | size: 24px; 108 | border: 0px; 109 | } 110 | 111 | element-text { 112 | expand: true; 113 | horizontal-align: 0; 114 | vertical-align: 0.5; 115 | margin: 0px 2.5px 0px 2.5px; 116 | } 117 | 118 | element selected { 119 | background-color: @se; 120 | text-color: @fg; 121 | border: 0px 0px 0px 0px; 122 | border-radius: 0px; 123 | border-color: @ac; 124 | } 125 | -------------------------------------------------------------------------------- /config/polybar/hack/scripts/rofi/styles.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "Iosevka Nerd Font 10"; 12 | show-icons: true; 13 | icon-theme: "Papirus"; 14 | display-drun: ""; 15 | drun-display-format: "{name}"; 16 | disable-history: false; 17 | fullscreen: false; 18 | hide-scrollbar: true; 19 | sidebar-mode: false; 20 | } 21 | 22 | @import "colors.rasi" 23 | 24 | window { 25 | transparency: "real"; 26 | background-color: @bg; 27 | text-color: @fg; 28 | border: 2px; 29 | border-color: @ac; 30 | border-radius: 0px; 31 | width: 300px; 32 | location: center; 33 | x-offset: 0; 34 | y-offset: 0; 35 | } 36 | 37 | prompt { 38 | enabled: true; 39 | padding: 10px 10px 10px 0px; 40 | background-color: @al; 41 | text-color: @ac; 42 | font: "Iosevka Nerd Font 10"; 43 | } 44 | 45 | textbox-prompt-colon { 46 | padding: 10px 15px 10px 15px; 47 | font: "Iosevka Nerd Font 10"; 48 | background-color: @al; 49 | text-color: @ac; 50 | expand: false; 51 | str: ""; 52 | } 53 | 54 | entry { 55 | background-color: @al; 56 | text-color: @ac; 57 | placeholder-color: @ac; 58 | expand: true; 59 | horizontal-align: 0; 60 | placeholder: "Search..."; 61 | padding: 10px 10px 10px 0px; 62 | border-radius: 0px; 63 | blink: true; 64 | } 65 | 66 | inputbar { 67 | children: [ textbox-prompt-colon, entry ]; 68 | background-color: @al; 69 | text-color: @fg; 70 | expand: false; 71 | border: 0px 0px 1px 0px; 72 | border-radius: 0px; 73 | border-color: @ac; 74 | spacing: 0px; 75 | } 76 | 77 | listview { 78 | background-color: @al; 79 | padding: 0px; 80 | columns: 1; 81 | lines: 5; 82 | spacing: 5px; 83 | cycle: true; 84 | dynamic: true; 85 | layout: vertical; 86 | } 87 | 88 | mainbox { 89 | background-color: @al; 90 | border: 0px; 91 | border-radius: 0px; 92 | border-color: @ac; 93 | children: [ inputbar, listview ]; 94 | spacing: 10px; 95 | padding: 2px 10px 10px 10px; 96 | } 97 | 98 | element { 99 | background-color: @al; 100 | text-color: @fg; 101 | orientation: horizontal; 102 | border-radius: 0px; 103 | padding: 8px 8px 8px -16px; 104 | } 105 | 106 | element-icon { 107 | size: 24px; 108 | border: 0px; 109 | } 110 | 111 | element-text { 112 | expand: true; 113 | horizontal-align: 0; 114 | vertical-align: 0.5; 115 | margin: 0px 2.5px 0px 2.5px; 116 | } 117 | 118 | element selected { 119 | background-color: @se; 120 | text-color: @fg; 121 | border: 0px 0px 0px 0px; 122 | border-radius: 0px; 123 | border-color: @ac; 124 | } 125 | -------------------------------------------------------------------------------- /config/polybar/hack/scripts/rofi/networkmenu.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "Iosevka Nerd Font 10"; 12 | show-icons: true; 13 | icon-theme: "Papirus"; 14 | display-drun: ""; 15 | drun-display-format: "{name}"; 16 | disable-history: false; 17 | fullscreen: false; 18 | hide-scrollbar: true; 19 | sidebar-mode: false; 20 | } 21 | 22 | @import "colors.rasi" 23 | 24 | window { 25 | transparency: "real"; 26 | background-color: @bg; 27 | text-color: @fg; 28 | border: 2px; 29 | border-color: @ac; 30 | border-radius: 0px; 31 | width: 400px; 32 | location: center; 33 | x-offset: 0; 34 | y-offset: 0; 35 | } 36 | 37 | prompt { 38 | enabled: true; 39 | padding: 10px 10px 10px 0px; 40 | background-color: @al; 41 | text-color: @ac; 42 | font: "Iosevka Nerd Font 10"; 43 | } 44 | 45 | textbox-prompt-colon { 46 | padding: 10px 15px 10px 15px; 47 | font: "Iosevka Nerd Font 10"; 48 | background-color: @al; 49 | text-color: @ac; 50 | expand: false; 51 | str: "直"; 52 | } 53 | 54 | entry { 55 | background-color: @al; 56 | text-color: @ac; 57 | placeholder-color: @ac; 58 | expand: true; 59 | horizontal-align: 0; 60 | placeholder: "Search..."; 61 | padding: 10px 10px 10px 0px; 62 | border-radius: 0px; 63 | blink: true; 64 | } 65 | 66 | inputbar { 67 | children: [ textbox-prompt-colon, prompt ]; 68 | background-color: @al; 69 | text-color: @fg; 70 | expand: false; 71 | border: 0px 0px 1px 0px; 72 | border-radius: 0px; 73 | border-color: @ac; 74 | spacing: 0px; 75 | } 76 | 77 | listview { 78 | background-color: @al; 79 | padding: 0px; 80 | columns: 1; 81 | lines: 8; 82 | spacing: 5px; 83 | cycle: true; 84 | dynamic: true; 85 | layout: vertical; 86 | } 87 | 88 | mainbox { 89 | background-color: @al; 90 | border: 0px; 91 | border-radius: 0px; 92 | border-color: @ac; 93 | children: [ inputbar, listview ]; 94 | spacing: 10px; 95 | padding: 2px 10px 10px 10px; 96 | } 97 | 98 | element { 99 | background-color: @al; 100 | text-color: @fg; 101 | orientation: horizontal; 102 | border-radius: 0px; 103 | padding: 8px 8px 8px -10px; 104 | } 105 | 106 | element-icon { 107 | size: 24px; 108 | border: 0px; 109 | } 110 | 111 | element-text { 112 | expand: true; 113 | horizontal-align: 0; 114 | vertical-align: 0.5; 115 | margin: 0px 2.5px 0px 2.5px; 116 | } 117 | 118 | element selected { 119 | background-color: @se; 120 | text-color: @fg; 121 | border: 0px 0px 0px 0px; 122 | border-radius: 0px; 123 | border-color: @ac; 124 | } 125 | -------------------------------------------------------------------------------- /config/nvim/lua/plugins/galaxyline/init.lua: -------------------------------------------------------------------------------- 1 | local gl = require('galaxyline') 2 | -- get my theme in galaxyline repo 3 | -- local colors = require('galaxyline.theme').default 4 | local colors = { 5 | bg = NONE, 6 | yellow = '#DCDCAA', 7 | dark_yellow = '#D7BA7D', 8 | cyan = '#4EC9B0', 9 | green = '#608B4E', 10 | light_green = '#B5CEA8', 11 | string_orange = '#CE9178', 12 | orange = '#FF8800', 13 | purple = '#C586C0', 14 | magenta = '#D16D9E', 15 | grey = '#858585', 16 | blue = '#569CD6', 17 | vivid_blue = '#4FC1FF', 18 | light_blue = '#9CDCFE', 19 | red = '#D16969', 20 | error_red = '#F44747' 21 | } 22 | local condition = require('galaxyline.condition') 23 | local gls = gl.section 24 | gl.short_line_list = {'NvimTree', 'vista', 'dbui', 'packer'} 25 | 26 | gls.left[1] = { 27 | ViMode = { 28 | provider = function() 29 | -- auto change color according the vim mode 30 | local mode_color = { 31 | n = colors.blue, 32 | i = colors.green, 33 | v = colors.purple, 34 | [''] = colors.purple, 35 | V = colors.purple, 36 | c = colors.magenta, 37 | no = colors.blue, 38 | s = colors.orange, 39 | S = colors.orange, 40 | [''] = colors.orange, 41 | ic = colors.yellow, 42 | R = colors.red, 43 | Rv = colors.red, 44 | cv = colors.blue, 45 | ce = colors.blue, 46 | r = colors.cyan, 47 | rm = colors.cyan, 48 | ['r?'] = colors.cyan, 49 | ['!'] = colors.blue, 50 | t = colors.blue 51 | } 52 | vim.api.nvim_command('hi GalaxyViMode guifg=' .. mode_color[vim.fn.mode()]) 53 | return '▊ ' 54 | end, 55 | highlight = {colors.red, colors.bg} 56 | } 57 | } 58 | print(vim.fn.getbufvar(0, 'ts')) 59 | vim.fn.getbufvar(0, 'ts') 60 | 61 | gls.left[2] = { 62 | GitIcon = { 63 | provider = function() 64 | return ' ' 65 | end, 66 | condition = condition.check_git_workspace, 67 | separator = ' ', 68 | separator_highlight = {'NONE', colors.bg}, 69 | highlight = {colors.orange, colors.bg} 70 | } 71 | } 72 | 73 | gls.left[3] = { 74 | GitBranch = { 75 | provider = 'GitBranch', 76 | condition = condition.check_git_workspace, 77 | separator = ' ', 78 | separator_highlight = {'NONE', colors.bg}, 79 | highlight = {colors.grey, colors.bg} 80 | } 81 | } 82 | 83 | gls.left[4] = { 84 | DiffAdd = { 85 | provider = 'DiffAdd', 86 | condition = condition.hide_in_width, 87 | icon = '  ', 88 | highlight = {colors.green, colors.bg} 89 | } 90 | } 91 | gls.left[5] = { 92 | DiffModified = { 93 | provider = 'DiffModified', 94 | condition = condition.hide_in_width, 95 | icon = ' 柳', 96 | highlight = {colors.blue, colors.bg} 97 | } 98 | } 99 | gls.left[6] = { 100 | DiffRemove = { 101 | provider = 'DiffRemove', 102 | condition = condition.hide_in_width, 103 | icon = '  ', 104 | highlight = {colors.red, colors.bg} 105 | } 106 | } 107 | 108 | gls.right[1] = { 109 | DiagnosticError = {provider = 'DiagnosticError', icon = '  ', highlight = {colors.error_red, colors.bg}} 110 | } 111 | gls.right[2] = {DiagnosticWarn = {provider = 'DiagnosticWarn', icon = '  ', highlight = {colors.orange, colors.bg}}} 112 | 113 | gls.right[3] = {DiagnosticHint = {provider = 'DiagnosticHint', icon = '  ', highlight = {colors.blue, colors.bg}}} 114 | 115 | gls.right[4] = {DiagnosticInfo = {provider = 'DiagnosticInfo', icon = '  ', highlight = {colors.blue, colors.bg}}} 116 | 117 | gls.right[5] = { 118 | ShowLspClient = { 119 | provider = 'GetLspClient', 120 | condition = function() 121 | local tbl = {['dashboard'] = true, [' '] = true} 122 | if tbl[vim.bo.filetype] then return false end 123 | return true 124 | end, 125 | icon = ' ', 126 | highlight = {colors.grey, colors.bg} 127 | } 128 | } 129 | 130 | gls.right[6] = { 131 | LineInfo = { 132 | provider = 'LineColumn', 133 | separator = ' ', 134 | separator_highlight = {'NONE', colors.bg}, 135 | highlight = {colors.grey, colors.bg} 136 | } 137 | } 138 | 139 | gls.right[7] = { 140 | PerCent = { 141 | provider = 'LinePercent', 142 | separator = ' ', 143 | separator_highlight = {'NONE', colors.bg}, 144 | highlight = {colors.grey, colors.bg} 145 | } 146 | } 147 | 148 | gls.right[8] = { 149 | Tabstop = { 150 | provider = function() 151 | return "Spaces: " .. vim.api.nvim_buf_get_option(0, "shiftwidth") .. " " 152 | end, 153 | condition = condition.hide_in_width, 154 | separator = ' ', 155 | separator_highlight = {'NONE', colors.bg}, 156 | highlight = {colors.grey, colors.bg} 157 | } 158 | } 159 | 160 | gls.right[9] = { 161 | BufferType = { 162 | provider = 'FileTypeName', 163 | condition = condition.hide_in_width, 164 | separator = ' ', 165 | separator_highlight = {'NONE', colors.bg}, 166 | highlight = {colors.grey, colors.bg} 167 | } 168 | } 169 | 170 | gls.right[10] = { 171 | FileEncode = { 172 | provider = 'FileEncode', 173 | condition = condition.hide_in_width, 174 | separator = ' ', 175 | separator_highlight = {'NONE', colors.bg}, 176 | highlight = {colors.grey, colors.bg} 177 | } 178 | } 179 | 180 | gls.right[11] = { 181 | Space = { 182 | provider = function() 183 | return ' ' 184 | end, 185 | separator = ' ', 186 | separator_highlight = {'NONE', colors.bg}, 187 | highlight = {colors.orange, colors.bg} 188 | } 189 | } 190 | 191 | gls.short_line_left[1] = { 192 | BufferType = { 193 | provider = 'FileTypeName', 194 | separator = ' ', 195 | separator_highlight = {'NONE', colors.bg}, 196 | highlight = {colors.grey, colors.bg} 197 | } 198 | } 199 | 200 | gls.short_line_left[2] = { 201 | SFileName = {provider = 'SFileName', condition = condition.buffer_not_empty, highlight = {colors.grey, colors.bg}} 202 | } 203 | 204 | gls.short_line_right[1] = {BufferIcon = {provider = 'BufferIcon', highlight = {colors.grey, colors.bg}}} 205 | 206 | -------------------------------------------------------------------------------- /config/nvim/lua/keymaps.lua: -------------------------------------------------------------------------------- 1 | -- Reference from: 2 | -- https://github.com/rainbowhxch/nvim/blob/f59569e874a8975a6c321b00c74e3554ff904e63/lua/mapping.lua 3 | -- Helper Functions for remapping easily 4 | require("plugins/telescope") 5 | local function map(mode, lhs, rhs) 6 | vim.api.nvim_set_keymap(mode, lhs, rhs, {silent = true}) 7 | end 8 | 9 | local function noremap(mode, lhs, rhs) 10 | vim.api.nvim_set_keymap(mode, lhs, rhs, {noremap = true, silent = true}) 11 | end 12 | 13 | local function nmap(lhs, rhs) 14 | map('n', lhs, rhs) 15 | end 16 | 17 | local function nnoremap(lhs, rhs) 18 | noremap('n', lhs, rhs) 19 | end 20 | 21 | local function vnoremap(lhs, rhs) 22 | noremap('v', lhs, rhs) 23 | end 24 | 25 | local function xnoremap(lhs, rhs) 26 | noremap('x', lhs, rhs) 27 | end 28 | 29 | local function inoremap(lhs, rhs) 30 | noremap('i', lhs, rhs) 31 | end 32 | 33 | local function tnoremap(lhs, rhs) 34 | noremap('t', lhs, rhs) 35 | end 36 | 37 | -- NVIM Compe Remaps 38 | local function exprnoremap(mode, lhs, rhs) 39 | vim.api.nvim_set_keymap(mode, lhs, rhs, {noremap = true, silent = true, expr = true}) 40 | end 41 | 42 | local function exprinoremap(lhs, rhs) 43 | exprnoremap('i', lhs, rhs) 44 | end 45 | 46 | exprinoremap('', 'compe#complete()') 47 | exprinoremap('', 'compe#confirm(\'\')') 48 | exprinoremap('', 'compe#close(\'\')') 49 | exprinoremap('', 'compe#scroll({ \'delta\': +4 })') 50 | exprinoremap('', 'compe#scroll({ \'delta\': -4 })') 51 | 52 | -- Map Leader Key to 53 | nnoremap('', '') 54 | vim.g.mapleader = ' ' 55 | nnoremap('', ':WhichKey \'\'') 56 | 57 | ---== LSP Saga ==--- 58 | 59 | -- Async Lsp Finder 60 | -- ----------------- 61 | -- lsp provider to find the cursor word definition and reference 62 | nnoremap('gh', ':Lspsaga lsp_finder') 63 | 64 | -- Code Action 65 | -- ----------- 66 | nnoremap('ca', ':Lspsaga code_action') 67 | vnoremap('ca', ':Lspsaga range_code_action') 68 | 69 | -- Hover Doc 70 | -- --------- 71 | nnoremap('K', ':Lspsaga hover_doc') 72 | -- scroll down hover doc or scroll in definition preview 73 | nnoremap("", "lua require(\'lspsaga.action\').smart_scroll_with_saga(1)") 74 | -- scroll up hover doc 75 | nnoremap("", "lua require(\'lspsaga.action\').smart_scroll_with_saga(-1)") 76 | 77 | -- Preview Definitions 78 | -- ------------------- 79 | nnoremap('cd', ':Lspsaga preview_definition') 80 | 81 | -- Goto Definition , Declatration, References, Implementations 82 | -- ------------------------------------------------------------ 83 | nnoremap('gd', 'lua vim.lsp.buf.definition()') 84 | nnoremap('gD', 'lua vim.lsp.buf.declaration()') 85 | nnoremap('gr', 'lua vim.lsp.buf.references()') 86 | nnoremap('gi', 'lua vim.lsp.buf.implementation()') 87 | 88 | -- Diagnostics 89 | -- ----------- 90 | nnoremap("", ":Lspsaga diagnostic_jump_prev") 91 | nnoremap("", ":Lspsaga diagnostic_jump_next") 92 | vim.cmd('command! -nargs=0 LspVirtualTextToggle lua require("lsp/virtual_text").toggle()') 93 | 94 | -- Show Errors under Cursor 95 | vim.cmd(':command ShowCursorError lua require\'lspsaga.diagnostic\'.show_cursor_diagnostics()') 96 | nnoremap("e", "ShowCursorError") 97 | 98 | -- Rename 99 | -- ------ 100 | nnoremap('cr', ':Lspsaga rename') 101 | 102 | --=======-- 103 | 104 | -- Command Line Mapping 105 | vim.cmd(':command SearchFiles lua require(\'telescope.builtin\').git_files()') 106 | vim.cmd(':command Find lua require(\'telescope.builtin\').live_grep()') 107 | vim.cmd(':command SearchVimConfig lua require(\'plugins/telescope\').search_dotfiles()') 108 | 109 | -- Toggle explorer 110 | nnoremap('', ':NvimTreeToggle') 111 | 112 | -- Toggle Integrated Terminal 113 | -- TODO: Remap to CTRL+` for more VSCode like experience 114 | nnoremap('t', ':ToggleTerm') 115 | tnoremap('t', ':ToggleTerm') 116 | 117 | -- Esc to get out of terminal 118 | tnoremap('', '') 119 | 120 | 121 | -- Search Dot files with Telescope 122 | nnoremap('nvc', ':SearchVimConfig') 123 | 124 | -- ctrl+p to search files 125 | nnoremap('', ':SearchFiles') 126 | nnoremap('lg', ':Find') 127 | 128 | -- quick fix lists 129 | nnoremap('qf', ':copen') 130 | nnoremap('qj', ':cnext') 131 | nnoremap('qk', ':cprevious') 132 | 133 | -- Neogit 134 | nnoremap('g', ':Neogit') 135 | 136 | -- Prettier 137 | vim.cmd(':command Prettify :lua vim.lsp.buf.formatting()') 138 | nnoremap("p", ":Prettify") 139 | 140 | -- Tab switch buffer 141 | nnoremap('', ':bnext') 142 | nnoremap('', ':bprevious') 143 | 144 | vim.cmd(':command ReloadLuaClient :lua vim.lsp.stop_client(vim.lsp.get_active_clients())') 145 | -- Force Reload the Lua client 146 | nnoremap('fl', ':ReloadLuaClient') 147 | -- Force Reload the buffer 148 | nnoremap('fb', ':edit') 149 | 150 | -- Undotree 151 | vim.cmd(':command Undotree :UndotreeShowh') 152 | nnoremap('u', ':Undotree') 153 | 154 | -- CTRL+W to close buffer 155 | nnoremap('', ':bd') 156 | 157 | -- Remove Highlights 158 | nmap('', ':nohl') 159 | 160 | -- Better Window Movement 161 | nnoremap('', ':wincmd h') 162 | nnoremap('', ':wincmd j') 163 | nnoremap('', ':wincmd k') 164 | nnoremap('', ':wincmd l') 165 | 166 | -- alt + hjkl to resize 167 | nnoremap('', ':vertical resize -2') 168 | nnoremap('', ':vertical resize +2') 169 | 170 | vim.cmd(':command LeftWindow :wincmd h') 171 | vim.cmd(':command DownWindow :wincmd j') 172 | vim.cmd(':command UpWindow :wincmd k') 173 | vim.cmd(':command RightWindow :wincmd l') 174 | 175 | nnoremap('h', ':LeftWindow') 176 | nnoremap('j', ':UpWindow') 177 | nnoremap('k', ':DownWindow') 178 | nnoremap('l', ':RightWindow') 179 | 180 | -- Alternate way to Save 181 | nnoremap('', ':w') 182 | 183 | -- ctrl+c behaves like Esc 184 | nnoremap('', '') 185 | 186 | -- Better Indenting 187 | vnoremap('<', '', '>gv') 189 | 190 | -- Move selected line / block of text with Alt + j,k 191 | xnoremap('', ':move \'>+1gv-gv') 192 | xnoremap('', ':move \'<-2gv-gv') 193 | 194 | nnoremap('', ':m .+1==') 195 | nnoremap('', ':m .-2==') 196 | 197 | inoremap('', ':m .+1==gi') 198 | inoremap('', ':m .-2==gi') 199 | 200 | -- Split Window Vertically 201 | nnoremap('v', ':vsplit') 202 | 203 | -------------------------------------------------------------------------------- /windows/settings.json: -------------------------------------------------------------------------------- 1 | 2 | // To view the default settings, hold "alt" while clicking on the "Settings" button. 3 | // For documentation on these settings, see: https://aka.ms/terminal-documentation 4 | 5 | { 6 | "$schema": "https://aka.ms/terminal-profiles-schema", 7 | "defaultProfile": "{2c4de342-38b7-51cf-b940-2309a097f518}", 8 | 9 | // Launch Settings 10 | "initialCols": 120, 11 | "initialRows": 30, 12 | "launchMode": "default", 13 | 14 | // Selection 15 | "copyOnSelect": false, 16 | "copyFormatting": true, 17 | "wordDelimiters": " /\\()\"'-.,:;<>~!@#$%^&*|+=[]{}~?\u2502", 18 | 19 | // Tab UI 20 | "alwaysShowTabs": true, 21 | "showTabsInTitlebar": true, 22 | "showTerminalTitleInTitlebar": true, 23 | "tabWidthMode": "equal", 24 | 25 | // Miscellaneous 26 | "confirmCloseAllTabs": true, 27 | "theme": "system", 28 | "rowsToScroll": "system", 29 | "snapToGridOnResize": true, 30 | 31 | "profiles": 32 | [ 33 | { 34 | "guid": "{2c4de342-38b7-51cf-b940-2309a097f518}", 35 | "hidden": false, 36 | "name": "Ubuntu", 37 | "source": "Windows.Terminal.Wsl", 38 | "colorScheme": "Night Owl", 39 | "fontFace": "CaskaydiaCove NF", 40 | "fontSize": 12, 41 | "useAcrylic": true, 42 | "acrylicOpacity": 0.7, 43 | "padding": "18, 18, 18, 18" 44 | }, 45 | { 46 | "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", 47 | "name": "Windows PowerShell", 48 | "commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", 49 | "icon": "ms-appx:///ProfileIcons/{61c54bbd-c2c6-5271-96e7-009a87ff44bf}.png", 50 | "colorScheme": "Campbell", 51 | "antialiasingMode": "grayscale", 52 | "closeOnExit": "graceful", 53 | "cursorShape": "bar", 54 | "fontFace": "Cascadia Mono", 55 | "fontSize": 12, 56 | "hidden": false, 57 | "historySize": 9001, 58 | "padding": "8, 8, 8, 8", 59 | "snapOnInput": true, 60 | "startingDirectory": "%USERPROFILE%", 61 | "useAcrylic": false 62 | }, 63 | { 64 | "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}", 65 | "name": "Command Prompt", 66 | "commandline": "%SystemRoot%\\System32\\cmd.exe", 67 | "icon": "ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png", 68 | "colorScheme": "Campbell", 69 | "antialiasingMode": "grayscale", 70 | "closeOnExit": "graceful", 71 | "cursorShape": "bar", 72 | "fontFace": "Cascadia Mono", 73 | "fontSize": 12, 74 | "hidden": false, 75 | "historySize": 9001, 76 | "padding": "8, 8, 8, 8", 77 | "snapOnInput": true, 78 | "startingDirectory": "%USERPROFILE%", 79 | "useAcrylic": false 80 | }, 81 | 82 | { 83 | "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}", 84 | "hidden": false, 85 | "name": "Azure Cloud Shell", 86 | "source": "Windows.Terminal.Azure" 87 | } 88 | ], 89 | "schemes": 90 | [ 91 | { 92 | "name": "Night Owl", 93 | "background": "#011627", 94 | "black": "#011627", 95 | "blue": "#82AAFF", 96 | "brightBlack": "#575656", 97 | "brightBlue": "#82AAFF", 98 | "brightCyan": "#7FDBCA", 99 | "brightGreen": "#22DA6E", 100 | "brightPurple": "#C792EA", 101 | "brightRed": "#EF5350", 102 | "brightWhite": "#FFFFFF", 103 | "brightYellow": "#FFEB95", 104 | "cyan": "#21C7A8", 105 | "foreground": "#D6DEEB", 106 | "green": "#22DA6E", 107 | "purple": "#C792EA", 108 | "red": "#EF5350", 109 | "white": "#ffffff", 110 | "yellow": "#ADDB67" 111 | } 112 | ], 113 | "keybindings": 114 | [ 115 | // Application-level Keys 116 | { "command": "closeWindow", "keys": "alt+f4" }, 117 | { "command": "toggleFullscreen", "keys": "alt+enter" }, 118 | { "command": "toggleFullscreen", "keys": "f11" }, 119 | { "command": "openNewTabDropdown", "keys": "ctrl+shift+space" }, 120 | { "command": "openSettings", "keys": "ctrl+," }, 121 | { "command": "find", "keys": "ctrl+shift+f" }, 122 | 123 | // Tab Management 124 | // "command": "closeTab" is unbound by default. 125 | // The closeTab command closes a tab without confirmation, even if it has multiple panes. 126 | { "command": "newTab", "keys": "ctrl+shift+t" }, 127 | { "command": { "action": "newTab", "index": 0 }, "keys": "ctrl+shift+1" }, 128 | { "command": { "action": "newTab", "index": 1 }, "keys": "ctrl+shift+2" }, 129 | { "command": { "action": "newTab", "index": 2 }, "keys": "ctrl+shift+3" }, 130 | { "command": { "action": "newTab", "index": 3 }, "keys": "ctrl+shift+4" }, 131 | { "command": { "action": "newTab", "index": 4 }, "keys": "ctrl+shift+5" }, 132 | { "command": { "action": "newTab", "index": 5 }, "keys": "ctrl+shift+6" }, 133 | { "command": { "action": "newTab", "index": 6 }, "keys": "ctrl+shift+7" }, 134 | { "command": { "action": "newTab", "index": 7 }, "keys": "ctrl+shift+8" }, 135 | { "command": { "action": "newTab", "index": 8 }, "keys": "ctrl+shift+9" }, 136 | { "command": "duplicateTab", "keys": "ctrl+shift+d" }, 137 | { "command": "nextTab", "keys": "ctrl+tab" }, 138 | { "command": "prevTab", "keys": "ctrl+shift+tab" }, 139 | { "command": { "action": "switchToTab", "index": 0 }, "keys": "ctrl+alt+1" }, 140 | { "command": { "action": "switchToTab", "index": 1 }, "keys": "ctrl+alt+2" }, 141 | { "command": { "action": "switchToTab", "index": 2 }, "keys": "ctrl+alt+3" }, 142 | { "command": { "action": "switchToTab", "index": 3 }, "keys": "ctrl+alt+4" }, 143 | { "command": { "action": "switchToTab", "index": 4 }, "keys": "ctrl+alt+5" }, 144 | { "command": { "action": "switchToTab", "index": 5 }, "keys": "ctrl+alt+6" }, 145 | { "command": { "action": "switchToTab", "index": 6 }, "keys": "ctrl+alt+7" }, 146 | { "command": { "action": "switchToTab", "index": 7 }, "keys": "ctrl+alt+8" }, 147 | { "command": { "action": "switchToTab", "index": 8 }, "keys": "ctrl+alt+9" }, 148 | 149 | // Pane Management 150 | { "command": "closePane", "keys": "ctrl+shift+w" }, 151 | { "command": { "action": "splitPane", "split": "horizontal" }, "keys": "alt+shift+-" }, 152 | { "command": { "action": "splitPane", "split": "vertical" }, "keys": "alt+shift+plus" }, 153 | { "command": { "action": "resizePane", "direction": "down" }, "keys": "alt+shift+down" }, 154 | { "command": { "action": "resizePane", "direction": "left" }, "keys": "alt+shift+left" }, 155 | { "command": { "action": "resizePane", "direction": "right" }, "keys": "alt+shift+right" }, 156 | { "command": { "action": "resizePane", "direction": "up" }, "keys": "alt+shift+up" }, 157 | { "command": { "action": "moveFocus", "direction": "down" }, "keys": "alt+down" }, 158 | { "command": { "action": "moveFocus", "direction": "left" }, "keys": "alt+left" }, 159 | { "command": { "action": "moveFocus", "direction": "right" }, "keys": "alt+right" }, 160 | { "command": { "action": "moveFocus", "direction": "up" }, "keys": "alt+up" }, 161 | 162 | // Clipboard Integration 163 | { "command": { "action": "copy", "singleLine": false }, "keys": "ctrl+shift+c" }, 164 | { "command": { "action": "copy", "singleLine": false }, "keys": "ctrl+insert" }, 165 | { "command": "paste", "keys": "ctrl+shift+v" }, 166 | { "command": "paste", "keys": "shift+insert" }, 167 | 168 | // Scrollback 169 | { "command": "scrollDown", "keys": "ctrl+shift+down" }, 170 | { "command": "scrollDownPage", "keys": "ctrl+shift+pgdn" }, 171 | { "command": "scrollUp", "keys": "ctrl+shift+up" }, 172 | { "command": "scrollUpPage", "keys": "ctrl+shift+pgup" }, 173 | 174 | // Visual Adjustments 175 | { "command": { "action": "adjustFontSize", "delta": 1 }, "keys": "ctrl+=" }, 176 | { "command": { "action": "adjustFontSize", "delta": -1 }, "keys": "ctrl+-" }, 177 | { "command": "resetFontSize", "keys": "ctrl+0" } 178 | ] 179 | } 180 | -------------------------------------------------------------------------------- /config/polybar/hack/user_modules.ini: -------------------------------------------------------------------------------- 1 | ;; ┌──────────────────────────────────────────────────────────────────────────────-----┐ 2 | ;; │░█▀█░█▀█░█░░░█░█░█▀▄░█▀█░█▀▄░░░░░░░░░█░█░█▀▀░█▀▀░█▀▄░░░█▄█░█▀█░█▀▄░█░█░█░░░█▀▀░█▀▀ │ 3 | ;; │░█▀▀░█░█░█░░░░█░░█▀▄░█▀█░█▀▄░░░░▀░░░░█░█░▀▀█░█▀▀░█▀▄░░░█░█░█░█░█░█░█░█░█░░░█▀▀░▀▀█ │ 4 | ;; │░▀░░░▀▀▀░▀▀▀░░▀░░▀▀░░▀░▀░▀░▀░░░░▀░░░░▀▀▀░▀▀▀░▀▀▀░▀░▀░░░▀░▀░▀▀▀░▀▀░░▀▀▀░▀▀▀░▀▀▀░▀▀▀ │ 5 | ;; │░Created░By░Aditya░Shakya░@adi1090x░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░│ 6 | ;; └──────────────────────────────────────────────────────────────────────────────-----┘ 7 | 8 | ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ 9 | 10 | [module/checknet] 11 | type = custom/script 12 | 13 | ; Available tokens: 14 | ; %counter% 15 | ; Command to be executed (using "/usr/bin/env sh -c [command]") 16 | exec = ~/.config/polybar/hack/scripts/check-network 17 | 18 | ; Conditional command that, if defined, needs to exit successfully 19 | ; before the main exec command is invoked. 20 | ; Default: "" 21 | ;;exec-if = "" 22 | 23 | ; Will the script output continous content? 24 | ; Default: false 25 | tail = true 26 | 27 | ; Seconds to sleep between updates 28 | ; Default: 2 (0 if `tail = true`) 29 | interval = 5 30 | 31 | ; Available tags: 32 | ; - deprecated 33 | ;