├── nvim ├── notes.md ├── spell │ ├── en.utf-8.add │ └── en.utf-8.add.spl ├── lua │ └── shxfee │ │ ├── config │ │ ├── customizations.lua │ │ ├── abbreviations.lua │ │ ├── commands.lua │ │ ├── statuscolumn.lua │ │ ├── options.lua │ │ ├── autocmds.lua │ │ └── keymaps.lua │ │ ├── util │ │ ├── disable_builtin.lua │ │ ├── playground.lua │ │ ├── utils.lua │ │ └── laravel.lua │ │ └── plugins │ │ ├── editor.lua │ │ ├── etc │ │ ├── cmp.lua │ │ ├── treesitter.lua │ │ └── telescope.lua │ │ ├── colorscheme.lua │ │ ├── ui.lua │ │ ├── lsp │ │ └── init.lua │ │ ├── temp.lua.bak │ │ └── coding.lua ├── minimal.lua ├── init.lua └── lazy-lock.json ├── .gitignore ├── install.sh ├── fish ├── starship.toml ├── fish_variables ├── config.fish └── conf.d │ └── nix-env.fish ├── lazygit └── config.yml ├── tmuxinator └── bithufangi.yml ├── bash └── bashrc ├── tmux └── tmux.conf └── emacs └── init.el /nvim/notes.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /lazygit/state.yml 2 | -------------------------------------------------------------------------------- /nvim/spell/en.utf-8.add: -------------------------------------------------------------------------------- 1 | todo 2 | nvim 3 | lsp 4 | neovim 5 | config 6 | neorg 7 | lua 8 | -------------------------------------------------------------------------------- /nvim/spell/en.utf-8.add.spl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shxfee/dotfiles/HEAD/nvim/spell/en.utf-8.add.spl -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | rm "$HOME/.config/fish" 3 | rm "$HOME/.config/nvim" 4 | rm "$HOME/.config/lazygit" 5 | 6 | base="$HOME/dotfiles" 7 | 8 | ln -sf ${base}/fish ~/.config/fish 9 | ln -sf ${base}/nvim ~/.config/nvim 10 | ln -sf ${base}/lazygit ~/.config/lazygit 11 | -------------------------------------------------------------------------------- /fish/starship.toml: -------------------------------------------------------------------------------- 1 | format = """\ 2 | $username\ 3 | $hostname\ 4 | $directory\ 5 | $git_branch\ 6 | $cmd_duration\ 7 | $custom\ 8 | $line_break\ 9 | $jobs\ 10 | $battery\ 11 | $time\ 12 | $character\ 13 | """ 14 | # $git_commit\ 15 | # $git_state\ 16 | # $git_status\ 17 | -------------------------------------------------------------------------------- /lazygit/config.yml: -------------------------------------------------------------------------------- 1 | gui: 2 | showBottomLine: false 3 | showIcons: true 4 | theme: 5 | selectedLineBgColor: 6 | - default 7 | unstagedChangesColor: 8 | - yellow 9 | os: 10 | editCommand: "nvr --remote-tab" 11 | openCommand: 'nvr' 12 | promptToReturnFromSubprocess: false 13 | -------------------------------------------------------------------------------- /nvim/lua/shxfee/config/customizations.lua: -------------------------------------------------------------------------------- 1 | -- Figure this shit out later 2 | -- Include (count)k/j in jump list 3 | vim.api.nvim_exec([[ 4 | nnoremap k (v:count > 1 ? "m'" . v:count : '') . 'k' 5 | nnoremap j (v:count > 1 ? "m'" . v:count : '') . 'j' 6 | vnoremap // y/\V=escape(@",'/\') 7 | ]], false) 8 | -------------------------------------------------------------------------------- /nvim/lua/shxfee/config/abbreviations.lua: -------------------------------------------------------------------------------- 1 | ------------------------------ COMMANDS --------------------------------------- 2 | -- Better API for commands and auto commands is being worked on. 3 | -- ref: https://github.com/neovim/neovim/pull/11613 4 | -- ref: https://github.com/neovim/neovim/pull/12378 5 | 6 | local cmd = vim.cmd 7 | 8 | cmd [[cabbrev w!! w :term sudo tee > /dev/null %]] 9 | -------------------------------------------------------------------------------- /tmuxinator/bithufangi.yml: -------------------------------------------------------------------------------- 1 | # /home/shxfee/.config/tmuxinator/bithufangi.yml 2 | 3 | name: bithufangi 4 | root: ~/development/centurion 5 | 6 | windows: 7 | - docker: dc up -d 8 | - vim: 9 | root: ~/development/centurion/logistics-internal-control 10 | panes: 11 | - vim 12 | - npm: docker exec app npm run watch --prefix ./logistics-internal-control 13 | - ssh: null 14 | -------------------------------------------------------------------------------- /bash/bashrc: -------------------------------------------------------------------------------- 1 | alias so='source ~/.config/bash/config.fish' 2 | alias se='nvim ~/.config/bash/config.fish' 3 | 4 | alias cdw='cd /var/www/' 5 | alias pu='./vendor/bin/phpunit' 6 | 7 | alias art='php artisan ' 8 | 9 | alias gpu='git push' 10 | alias gpl='git pull' 11 | alias gs='git status' 12 | alias gf='git fetch' 13 | alias ga='git add' 14 | alias gc='git commit' 15 | alias gl='git log --oneline' 16 | alias gtags='ctags -R --exclude=node_modules --exclude=.git --exclude=tests' 17 | 18 | # update path 19 | set PATH /home/shxfee/.composer/vendor/bin $PATH 20 | -------------------------------------------------------------------------------- /nvim/lua/shxfee/util/disable_builtin.lua: -------------------------------------------------------------------------------- 1 | vim.g.loaded_gzip = 1 2 | vim.g.loaded_zip = 1 3 | vim.g.loaded_zipPlugin = 1 4 | vim.g.loaded_tar = 1 5 | vim.g.loaded_tarPlugin = 1 6 | 7 | vim.g.loaded_getscript = 1 8 | vim.g.loaded_getscriptPlugin = 1 9 | vim.g.loaded_vimball = 1 10 | vim.g.loaded_vimballPlugin = 1 11 | vim.g.loaded_2html_plugin = 1 12 | 13 | -- vim.g.loaded_matchit = 1 14 | vim.g.loaded_matchparen = 1 15 | vim.g.loaded_logiPat = 1 16 | vim.g.loaded_rrhelper = 1 17 | 18 | vim.g.loaded_netrw = 1 19 | vim.g.loaded_netrwPlugin = 1 20 | vim.g.loaded_netrwSettings = 1 21 | -------------------------------------------------------------------------------- /nvim/lua/shxfee/util/playground.lua: -------------------------------------------------------------------------------- 1 | ------------------------------ TEMP ------------------------------------------- 2 | -- Figure this shit out yo! 3 | -- TODO extract this function to lua 4 | vim.api.nvim_exec( 5 | [[ 6 | vnoremap zy :call CopyFoldHeader() 7 | fun! CopyFoldHeader() range 8 | let @z = '' 9 | 10 | for i in range(a:firstline, a:lastline) 11 | if i == foldclosed(i) || foldclosed(i) == -1 12 | let line = substitute(getline(i), '^\s*[*,#,-]\s*\(\[ \]\)*', '', '') 13 | let @z .= trim(line) . "\n" 14 | endif 15 | endfor 16 | 17 | let @+ = @z 18 | endfun 19 | ]], false 20 | ) 21 | 22 | vim.api.nvim_exec([[ command! -nargs=1 Cheat call luaeval('get_cheat_sh(_A[1])', ['']) ]], false) 23 | -------------------------------------------------------------------------------- /nvim/lua/shxfee/config/commands.lua: -------------------------------------------------------------------------------- 1 | -- Run command in interactive terminal 2 | vim.api.nvim_create_user_command( 3 | "T", 4 | function (opts) 5 | vim.cmd("split | terminal") 6 | local args = table.concat(opts.fargs, ' ') 7 | vim.defer_fn(function() 8 | -- Source the file 9 | vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("source ~/.bash_nvim_aliases\r", true, true, true), 't', true) 10 | -- Feed the command after a short delay to ensure the source command is executed 11 | vim.defer_fn(function() 12 | vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(args .. "\r", true, true, true), 't', true) 13 | end, 5) -- Additional delay in milliseconds 14 | end, 30) -- Initial delay in milliseconds 15 | end, 16 | { nargs = "*", complete = "file" } 17 | ) 18 | -------------------------------------------------------------------------------- /nvim/minimal.lua: -------------------------------------------------------------------------------- 1 | -- DO NOT change the paths and don't remove the colorscheme 2 | local root = vim.fn.fnamemodify("./.repro", ":p") 3 | 4 | -- set stdpaths to use .repro 5 | for _, name in ipairs({ "config", "data", "state", "cache" }) do 6 | vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name 7 | end 8 | 9 | -- bootstrap lazy 10 | local lazypath = root .. "/plugins/lazy.nvim" 11 | if not vim.loop.fs_stat(lazypath) then 12 | vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, }) 13 | end 14 | vim.opt.runtimepath:prepend(lazypath) 15 | 16 | -- install plugins 17 | local plugins = { 18 | "folke/tokyonight.nvim", 19 | -- add any other plugins here 20 | } 21 | require("lazy").setup(plugins, { 22 | root = root .. "/plugins", 23 | }) 24 | 25 | vim.cmd.colorscheme("tokyonight") 26 | -- add anything else here 27 | -------------------------------------------------------------------------------- /nvim/lua/shxfee/config/statuscolumn.lua: -------------------------------------------------------------------------------- 1 | -- reference folke reddit comment 2 | -- https://www.reddit.com/r/neovim/comments/10fpqbp/comment/j50be6b 3 | local M = {} 4 | _G.Status = M 5 | 6 | ---@return {name:string, text:string, texthl:string}[] 7 | function M.get_signs() 8 | local buf = vim.api.nvim_win_get_buf(vim.g.statusline_winid) 9 | local signs = vim.fn.sign_getplaced(buf, { group = "*", lnum = vim.v.lnum }) 10 | if #signs == 0 or #signs[1].signs == 0 then 11 | return {} 12 | end 13 | return vim.tbl_map(function(sign) 14 | local sign_def = vim.fn.sign_getdefined(sign.name) 15 | if #sign_def > 0 then 16 | return sign_def[1] 17 | end 18 | end, signs[1].signs) 19 | end 20 | 21 | function M.column() 22 | local sign, git_sign 23 | for _, s in ipairs(M.get_signs()) do 24 | if s and s.name:find("GitSign") then 25 | git_sign = s 26 | elseif s then 27 | sign = s 28 | end 29 | end 30 | local components = { 31 | sign and ("%#" .. sign.texthl .. "#" .. sign.text .. "%*") or " ", 32 | [[%=]], 33 | [[%{&nu?(&rnu&&v:relnum?v:relnum:v:lnum):''} ]], 34 | git_sign and ("%#" .. git_sign.texthl .. "#" .. git_sign.text .. "%*") or "│ ", 35 | } 36 | return table.concat(components, "") 37 | end 38 | 39 | vim.opt.statuscolumn = [[%!v:lua.Status.column()]] 40 | 41 | return M 42 | -------------------------------------------------------------------------------- /fish/fish_variables: -------------------------------------------------------------------------------- 1 | # This file contains fish universal variable definitions. 2 | # VERSION: 3.0 3 | SETUVAR __fish_initialized:3100 4 | SETUVAR fish_color_autosuggestion:555\x1ebrblack 5 | SETUVAR fish_color_cancel:\x2dr 6 | SETUVAR fish_color_command:005fd7 7 | SETUVAR fish_color_comment:990000 8 | SETUVAR fish_color_cwd:green 9 | SETUVAR fish_color_cwd_root:red 10 | SETUVAR fish_color_end:009900 11 | SETUVAR fish_color_error:ff0000 12 | SETUVAR fish_color_escape:00a6b2 13 | SETUVAR fish_color_history_current:\x2d\x2dbold 14 | SETUVAR fish_color_host:normal 15 | SETUVAR fish_color_host_remote:yellow 16 | SETUVAR fish_color_normal:normal 17 | SETUVAR fish_color_operator:00a6b2 18 | SETUVAR fish_color_param:00afff 19 | SETUVAR fish_color_quote:999900 20 | SETUVAR fish_color_redirection:00afff 21 | SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack 22 | SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack 23 | SETUVAR fish_color_status:red 24 | SETUVAR fish_color_user:brgreen 25 | SETUVAR fish_color_valid_path:\x2d\x2dunderline 26 | SETUVAR fish_key_bindings:fish_default_key_bindings 27 | SETUVAR fish_pager_color_completion:\x1d 28 | SETUVAR fish_pager_color_description:B3A06D\x1eyellow 29 | SETUVAR fish_pager_color_prefix:white\x1e\x2d\x2dbold\x1e\x2d\x2dunderline 30 | SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan 31 | -------------------------------------------------------------------------------- /nvim/lua/shxfee/util/utils.lua: -------------------------------------------------------------------------------- 1 | local fn, cmd = vim.fn, vim.cmd 2 | 3 | local M = {} 4 | 5 | -- Wrapper to execute tests via vim-test 6 | -- If we are in a test file, execute the nearest test to the cursor 7 | -- Otherwise execute the last test 8 | function M.run_nearest_or_last_test() 9 | local filename = fn.expand('%') 10 | 11 | if filename:match('Test.*') or filename:match('test.*') then 12 | vim.cmd [[ TestNearest ]] 13 | else 14 | vim.cmd [[ TestLast ]] 15 | end 16 | end 17 | 18 | -- Show documentation 19 | -- If filetype is vim or help search vim help 20 | -- Otherwise execute CocAction 21 | function M.open_documentation() 22 | if vim.tbl_contains({'vim', 'help', 'lua'}, vim.bo.filetype) then 23 | vim.cmd('help ' .. fn.expand('')) 24 | else 25 | vim.cmd [[ call CocAction('doHover') ]] 26 | end 27 | end 28 | 29 | 30 | -- Print the syntax group of the text under cursor 31 | -- Helper I sometimes use when debugging color schemes 32 | function M.print_syn_group() 33 | local s = fn.synID(fn.line('.'), fn.col('.'), 1) 34 | print(fn.synIDattr(s, 'name') .. ' -> ' .. fn.synIDattr(fn.synIDtrans(s), 'name')) 35 | end 36 | 37 | 38 | -- Compile and run C program 39 | function M.compile_and_run_c() 40 | local filename = fn.expand('%<') 41 | 42 | cmd'w | sp' 43 | cmd('term gcc -Wall ' .. fn.shellescape('%') .. ' -o ' .. fn.shellescape('%:r')) 44 | 45 | vim.wait(200, function() 46 | end) 47 | 48 | cmd('sp') 49 | cmd('term ./' .. filename) 50 | end 51 | 52 | return M 53 | -------------------------------------------------------------------------------- /nvim/lua/shxfee/config/options.lua: -------------------------------------------------------------------------------- 1 | local opt = vim.opt 2 | 3 | -- ui 4 | opt.number = true 5 | opt.relativenumber = true 6 | opt.colorcolumn = "" 7 | opt.termguicolors = true 8 | opt.showmode = false 9 | opt.showcmd = false 10 | opt.inccommand = "nosplit" 11 | opt.laststatus = 3 12 | opt.hlsearch = true 13 | opt.hidden = true 14 | opt.cmdheight = 2 15 | opt.pumheight = 10 16 | opt.conceallevel = 2 17 | opt.concealcursor = "nc" 18 | 19 | -- windows 20 | opt.splitbelow = true 21 | opt.scrolloff = 10 22 | opt.winwidth = 110 23 | opt.winminwidth = 30 24 | 25 | -- text 26 | opt.wrap = false 27 | opt.breakindent = true 28 | opt.autoindent = true 29 | opt.shiftwidth = 4 30 | opt.tabstop = 4 31 | opt.softtabstop = 4 32 | opt.expandtab = true 33 | opt.ignorecase = true 34 | opt.smartcase = true 35 | opt.spell = true 36 | opt.spelllang = "en_us" 37 | 38 | opt.updatetime = 300 39 | opt.timeout = true 40 | opt.timeoutlen = 500 41 | opt.shortmess:append("cI") 42 | opt.completeopt = { "menu", "menuone", "noselect" } 43 | opt.signcolumn = "yes:1" 44 | opt.nrformats = "bin,hex,alpha" 45 | opt.clipboard = "" 46 | opt.undofile = true 47 | 48 | opt.viewoptions = { "cursor", "folds" } 49 | opt.formatoptions = opt.formatoptions 50 | - "t" -- Auto-wrap 51 | + "c" -- Auto-wrap comments 52 | - "r" -- Auto insert comment when pressing enter. 53 | - "o" -- Auto insert comment when pressing O and o 54 | + "q" -- Allow formatting comments w/ gq 55 | - "a" -- Auto formatting of paragraphs 56 | + "n" -- When formatting text, recognize numbered lists 57 | - "2" -- When formatting text, use the indent of the second line of a paragraph 58 | + "j" -- Where it makes sense, remove a comment leader when joining lines 59 | -------------------------------------------------------------------------------- /fish/config.fish: -------------------------------------------------------------------------------- 1 | alias vi='~/source/nvim/squashfs-root/usr/bin/nvim' 2 | alias vim='~/source/nvim/squashfs-root/usr/bin/nvim' 3 | alias nvim='~/source/nvim/squashfs-root/usr/bin/nvim' 4 | alias so='source ~/.config/fish/config.fish' 5 | alias se='vi ~/.config/fish/config.fish' 6 | 7 | alias cdw='cd /var/www/' 8 | alias pu='./vendor/bin/phpunit' 9 | 10 | alias art='php artisan ' 11 | alias sail='./vendor/bin/sail' 12 | 13 | alias gpu='git push' 14 | alias gpl='git pull' 15 | alias gs='git status' 16 | alias gf='git fetch' 17 | alias ga='git add' 18 | alias gc='git commit' 19 | alias gl='git log --oneline' 20 | alias gtags='ctags -R --exclude=node_modules --exclude=.git --exclude=tests' 21 | 22 | alias windown='sudo umount /mnt/c' 23 | alias winup='sudo mount -t drvfs C: /mnt/c' 24 | 25 | # update path 26 | set PATH /home/shxfee/.composer/vendor/bin $PATH 27 | set PATH /home/shxfee/bin $PATH 28 | 29 | # Open links with wslview 30 | set BROWSER wslview 31 | 32 | # Start the Mysql Server and Apache Serve 33 | # Run also bunch stuff here in the future for starting off the Development Env 34 | function serve --description 'Bootstrap the dev environment' 35 | sudo service php7.4-fpm start; and sudo service nginx start; and sudo service mysql start 36 | end 37 | 38 | set -x STARSHIP_CONFIG ~/.config/fish/starship.toml 39 | starship init fish | source 40 | 41 | 42 | # This is specific to WSL 2. If the WSL 2 VM goes rogue and decides not to free 43 | # up memory, this command will free your memory after about 20-30 seconds. 44 | # Details: https://github.com/microsoft/WSL/issues/4166#issuecomment-628493643 45 | alias drop_cache="sudo sh -c \"echo 3 >'/proc/sys/vm/drop_caches' && swapoff -a && swapon -a && printf '\n%s\n' 'Ram-cache and Swap Cleared'\"" 46 | -------------------------------------------------------------------------------- /nvim/lua/shxfee/plugins/editor.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- file manager 3 | { 4 | 'stevearc/oil.nvim', 5 | dependencies = { "nvim-web-devicons" }, 6 | lazy = false, 7 | opts = { 8 | skip_confirm_for_simple_edits = true, 9 | view_options = { 10 | show_hidden = true, 11 | }, 12 | }, 13 | keys = { 14 | { "-", "lua require('oil').open()", desc = "open current directory" }, 15 | }, 16 | }, 17 | 18 | -- fuzzy finder 19 | -- plugins/etc/telescope.lua 20 | { 21 | "nvim-telescope/telescope.nvim", 22 | }, 23 | 24 | -- leap motion 25 | { 26 | "ggandor/leap.nvim", 27 | keys = { 28 | { 29 | "s", 30 | "(leap-forward-to)", 31 | mode = { "n", "v" }, 32 | desc = "Leap Forward to", 33 | }, 34 | { 35 | "S", 36 | "(leap-backward-to)", 37 | mode = { "n", "v" }, 38 | desc = "Leap Backward to", 39 | }, 40 | }, 41 | config = true, 42 | }, 43 | 44 | -- surround 45 | { 46 | "kylechui/nvim-surround", 47 | keys = { 48 | { "ys" }, 49 | { "ds" }, 50 | { "cs", desc = "Change Surrounding Pair" }, 51 | 52 | { "S", mode = "v" }, 53 | }, 54 | config = true, 55 | }, 56 | 57 | -- which-key 58 | { 59 | "folke/which-key.nvim", 60 | lazy = false, 61 | opts = { 62 | keys = { 63 | scroll_down = '', 64 | scroll_up = '', 65 | }, 66 | win = { 67 | border = "single", 68 | }, 69 | triggers = { 70 | { "", mode = "nixstc" }, 71 | }, 72 | }, 73 | }, 74 | 75 | -- notes 76 | { 77 | 'MeanderingProgrammer/markdown.nvim', 78 | dependencies = { 79 | 'nvim-treesitter/nvim-treesitter', 80 | 'nvim-tree/nvim-web-devicons' 81 | }, 82 | config = true, 83 | }, 84 | } 85 | -------------------------------------------------------------------------------- /nvim/lua/shxfee/config/autocmds.lua: -------------------------------------------------------------------------------- 1 | local mygroup = vim.api.nvim_create_augroup("vimrc", { clear = true }) 2 | 3 | 4 | -- resotre cursor position 5 | vim.api.nvim_create_autocmd("BufReadPost", { 6 | callback = function() 7 | if vim.fn.line("'\"") >= 1 and vim.fn.line("'\"") <= vim.fn.line("$") and vim.fn.expand("&ft") ~= "commit" then 8 | vim.cmd('normal! g`"') 9 | end 10 | end, 11 | group = mygroup, 12 | desc = "Restore cursor position", 13 | }) 14 | 15 | -- terminal settings because there is no ft for terminal 16 | -- starting over 17 | -- vim.api.nvim_create_autocmd("TermOpen", { 18 | -- callback = function() 19 | -- vim.opt_local.wrap = false 20 | -- vim.opt_local.number = false 21 | -- vim.opt_local.relativenumber = false 22 | -- vim.opt_local.statuscolumn = "" 23 | -- vim.cmd.startinsert() 24 | -- end, 25 | -- group = mygroup, 26 | -- desc = "Set terminal options", 27 | -- }) 28 | 29 | -- reload config on save 30 | vim.api.nvim_create_autocmd("BufWritePost", { 31 | pattern = "**/lua/shxfee/config/*.lua", 32 | callback = function() 33 | local filepath = vim.fn.expand("%") 34 | 35 | dofile(filepath) 36 | vim.notify("Configuration reloaded \n" .. filepath, nil, { 37 | title = "autocmds.lua", 38 | }) 39 | end, 40 | group = mygroup, 41 | desc = "Reload config on save", 42 | }) 43 | 44 | -- autoformat code on save 45 | vim.api.nvim_create_autocmd("BufWritePre", { 46 | pattern = { 47 | "*.php", "*.vue", "*.js", "*.ts", "*.tsx", "*.json", "*.css", 48 | "*.scss", "*.html" 49 | }, 50 | callback = function() 51 | -- noop if no lsp 52 | vim.lsp.buf.format() 53 | end, 54 | group = mygroup, 55 | desc = "Autoformat code on save", 56 | }) 57 | 58 | -- disable diagnostics for .env files 59 | vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { 60 | pattern = ".env", 61 | callback = function() 62 | vim.diagnostic.disable() 63 | end, 64 | group = mygroup, 65 | desc = "Disable diagnostics for .env files", 66 | }) 67 | -------------------------------------------------------------------------------- /nvim/lua/shxfee/plugins/etc/cmp.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "hrsh7th/nvim-cmp", 4 | 5 | dependencies = { 6 | "neovim/nvim-lspconfig", 7 | "hrsh7th/cmp-nvim-lsp", 8 | "hrsh7th/cmp-buffer", 9 | "hrsh7th/cmp-path", 10 | "hrsh7th/nvim-cmp", 11 | "f3fora/cmp-spell", 12 | }, 13 | 14 | config = function(plugin, opts) 15 | local cmp = require("cmp") 16 | 17 | cmp.setup({ 18 | window = { 19 | completion = cmp.config.window.bordered(), 20 | documentation = cmp.config.window.bordered(), 21 | }, 22 | mapping = cmp.mapping.preset.insert({ 23 | [''] = cmp.mapping.scroll_docs(-4), 24 | [''] = cmp.mapping.scroll_docs(4), 25 | [''] = cmp.mapping.complete(), 26 | [''] = cmp.mapping.abort(), 27 | [''] = cmp.mapping.confirm({ select = true }), 28 | }), 29 | sources = cmp.config.sources( 30 | {{ 31 | name = 'nvim_lsp' 32 | },}, 33 | {{ 34 | name = 'buffer', 35 | option = { 36 | get_bufnrs = function() 37 | return vim.api.nvim_list_bufs() 38 | end 39 | } 40 | },}, 41 | {{ 42 | name = "spell", 43 | option = { 44 | keep_all_entries = false, 45 | enable_in_context = function() 46 | return true 47 | end, 48 | preselect_correct_word = true, 49 | }, 50 | },} 51 | ) 52 | }) 53 | 54 | cmp.setup.filetype('gitcommit', { 55 | sources = cmp.config.sources({ 56 | -- { name = 'cmp_git' }, 57 | }, { 58 | { name = 'buffer' }, 59 | }) 60 | }) 61 | 62 | -- cmp.setup.cmdline({ '/', '?' }, { 63 | -- mapping = cmp.mapping.preset.cmdline(), 64 | -- sources = { 65 | -- { name = 'buffer' } 66 | -- } 67 | -- }) 68 | end, 69 | }, 70 | } 71 | -------------------------------------------------------------------------------- /nvim/lua/shxfee/plugins/etc/treesitter.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-treesitter/nvim-treesitter", 4 | version = false, -- last release is way too old and doesn't work on Windows 5 | build = ":TSUpdate", 6 | event = "BufReadPost", 7 | keys = { 8 | { "", desc = "Increment selection" }, 9 | { "", desc = "Schrink selection", mode = "x" }, 10 | }, 11 | ---@type TSConfig 12 | opts = { 13 | highlight = { 14 | enable = true, 15 | disable = { 16 | -- "vue", 17 | }, 18 | -- support for these suck in treesitter atm 2023-03-03 19 | additional_vim_regex_highlighting = { 20 | "php", 21 | "vue", 22 | }, 23 | }, 24 | indent = { 25 | enable = true, 26 | disable = { 27 | -- indent files from the old plugin still works better 28 | "vue", 29 | }, 30 | }, 31 | context_commentstring = { enable = true, enable_autocmd = false }, 32 | ensure_installed = { 33 | "bash", 34 | "css", 35 | "scss", 36 | "html", 37 | "javascript", 38 | "json", 39 | "jsonc", 40 | "lua", 41 | "markdown", 42 | "markdown_inline", 43 | "php", 44 | "python", 45 | "query", 46 | "regex", 47 | "tsx", 48 | "typescript", 49 | "vim", 50 | "vimdoc", 51 | "vue", 52 | "yaml", 53 | }, 54 | incremental_selection = { 55 | enable = true, 56 | keymaps = { 57 | init_selection = "", 58 | node_incremental = "", 59 | scope_incremental = "", 60 | node_decremental = "", 61 | }, 62 | }, 63 | }, 64 | ---@param opts TSConfig 65 | config = function(plugin, opts) 66 | if plugin.ensure_installed then 67 | require("lazyvim.util").deprecate("treesitter.ensure_installed", "treesitter.opts.ensure_installed") 68 | end 69 | require("nvim-treesitter.configs").setup(opts) 70 | end, 71 | }, 72 | } 73 | -------------------------------------------------------------------------------- /nvim/lua/shxfee/util/laravel.lua: -------------------------------------------------------------------------------- 1 | local vim = vim 2 | local fn = vim.fn 3 | 4 | local M = {} 5 | 6 | -- Read laravel env into a table 7 | function M.read_env() 8 | local readable, file = pcall(fn.readfile, '.env') 9 | if not readable then return {} end 10 | 11 | return file 12 | end 13 | 14 | 15 | -- Check if pwd is a laravel project 16 | -- Check for the existance of laravel package in vendor directory 17 | function M.is_laravel() 18 | return fn.filereadable('vendor/laravel/framework/composer.json') ~= 0 19 | end 20 | 21 | 22 | -- Parse Env into a lua table 23 | function M.get_env() 24 | local env = {} 25 | 26 | for _, line in ipairs(M.read_env()) do 27 | local splits = vim.split(line, '=') 28 | 29 | if (splits[1] ~= nil) then 30 | env[splits[1]] = splits[2] 31 | end 32 | end 33 | 34 | return env 35 | end 36 | 37 | 38 | -- Get the global DB connection string for DADBOD 39 | function M.get_db_connection_string() 40 | if not M.is_laravel() then return nil end 41 | 42 | local e = M.get_env() 43 | local con = "mysql://%s:%s@localhost/%s" 44 | 45 | return string.format( 46 | con, 47 | e.DB_USERNAME, 48 | e.DB_PASSWORD, 49 | e.DB_DATABASE 50 | ) 51 | end 52 | 53 | 54 | -- Set the global DB connection string for DADBOD 55 | function M.set_db_connection_string() 56 | vim.g.db = M.get_db_connection_string() 57 | end 58 | 59 | 60 | -- Open adminer on the browser 61 | function M.open_adminer() 62 | if not M.is_laravel() then return nil end 63 | 64 | local c = '!cmd.exe /C start ' 65 | local e = M.get_env() 66 | 67 | local a = 'http://localhost/adminer?username='.. e.DB_USERNAME .. '^&db=' .. e.DB_DATABASE 68 | c = c .. fn.shellescape(a) 69 | 70 | pcall(fn.execute, c) 71 | end 72 | 73 | 74 | -- Open the application on the browser 75 | function M.open_app() 76 | if not M.is_laravel() then return nil end 77 | 78 | local c = '!cmd.exe /C start ' 79 | local e = M.get_env() 80 | 81 | local a = 'http://localhost/' 82 | 83 | if e.APP_URL ~= nil then 84 | a = e.APP_URL 85 | end 86 | 87 | c = c .. fn.shellescape(a) 88 | 89 | pcall(fn.execute, c) 90 | end 91 | 92 | return M 93 | -------------------------------------------------------------------------------- /nvim/init.lua: -------------------------------------------------------------------------------- 1 | -- github.com/shxfee/ 2 | -- 3 | -- plugins are managed by lazy.nvim and all specs are in lua/shxfee/plugins 4 | -- 5 | -- all configurations are in lua/shxfee/config and supports hot reloading. 6 | -- the config directory contains separate files for options, keymaps, autocmds, 7 | -- commands and abbreviations. customizations.lua is for all customizations 8 | -- that do not fit into the other categories. 9 | -- 10 | -- i have borrowed heavily from tjdevries and lazyvim 11 | -- 12 | -- references 13 | -- https://github.com/tjdevries/config_manager/blob/master/xdg_config/nvim 14 | -- https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim 15 | 16 | 17 | vim.g.mapleader = " " 18 | vim.g.localleader = "\\" 19 | 20 | -- Bootstrap lazy.nvim 21 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 22 | if not (vim.uv or vim.loop).fs_stat(lazypath) then 23 | local lazyrepo = "https://github.com/folke/lazy.nvim.git" 24 | local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) 25 | if vim.v.shell_error ~= 0 then 26 | vim.api.nvim_echo({ 27 | { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, 28 | { out, "WarningMsg" }, 29 | { "\nPress any key to exit..." }, 30 | }, true, {}) 31 | vim.fn.getchar() 32 | os.exit(1) 33 | end 34 | end 35 | vim.opt.rtp:prepend(lazypath) 36 | 37 | 38 | -- Lazy automatically loads all specs form the plugins dir 39 | require("lazy").setup({ 40 | spec = { 41 | { import = "shxfee.plugins" }, 42 | { import = "shxfee.plugins.etc" }, 43 | }, 44 | install = { missing = false }, 45 | ui = { border = "rounded" }, 46 | performance = { 47 | rtp = { 48 | disabled_plugins = { 49 | "gzip", 50 | "tarPlugin", 51 | "tohtml", 52 | "tutor", 53 | -- "matchit", 54 | "matchparen", 55 | "netrwPlugin", 56 | "zipPlugin", 57 | }, 58 | }, 59 | }, 60 | }) 61 | 62 | -- editor options 63 | require("shxfee.config.options") 64 | 65 | -- general keymaps 66 | require("shxfee.config.keymaps") 67 | 68 | -- global autocmds 69 | require("shxfee.config.autocmds") 70 | 71 | -- custom commands 72 | require("shxfee.config.commands") 73 | 74 | -- abbreviations 75 | require("shxfee.config.abbreviations") 76 | 77 | -- other customizations 78 | require("shxfee.config.customizations") 79 | 80 | -- statuscolumn 81 | -- require("shxfee.config.statuscolumn") 82 | -------------------------------------------------------------------------------- /tmux/tmux.conf: -------------------------------------------------------------------------------- 1 | # tmux configuration 2 | # forked from https://github.com/tony/tmux-config/blob/master/.tmux.conf 3 | 4 | # https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf 5 | set-option -g status-style bg=colour235,fg=colour136,default # bg=base02, fg=yellow 6 | 7 | # default window title colors 8 | set-window-option -g window-status-style fg=colour245,bg=default # fg=base0 9 | 10 | # active window title colors 11 | set-window-option -g window-status-current-style fg=colour255,bg=default # fg=orange 12 | 13 | # auto window rename 14 | set-window-option -g automatic-rename 15 | 16 | # automatically renumber windws 17 | set-option -g renumber-windows on 18 | 19 | set-option -g focus-events on 20 | 21 | # easy reload config 22 | bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded." 23 | 24 | # create a window with a given name 25 | bind-key C command-prompt -p "Name of new window: " "new-window -n '%%'" 26 | 27 | # pane border 28 | set-option -g pane-border-style fg=colour240 29 | set-option -g pane-active-border-style fg=colour240 30 | 31 | # message text 32 | set-option -g message-style bg=colour235,fg=colour166 # bg=base02, fg=orange 33 | 34 | # pane number display 35 | set-option -g display-panes-active-colour colour33 #blue 36 | set-option -g display-panes-colour colour166 #orange 37 | 38 | # Remove status bar right hand 39 | set -g status-interval 1 40 | set -g status-justify centre # center align window list 41 | set -g status-left '#[default]' 42 | set -g status-right '' 43 | 44 | 45 | # Start window numbering at 1 46 | set -g base-index 1 47 | setw -g pane-base-index 1 48 | set -g mouse on 49 | 50 | # Allows for faster key repetition 51 | set -s escape-time 10 52 | 53 | # Rather than constraining window size to the maximum size of any client 54 | # connected to the *session*, constrain window size to the maximum size of any 55 | # client connected to *that window*. Much more reasonable. 56 | setw -g aggressive-resize on 57 | 58 | # visual notification of activity in other windows 59 | setw -g monitor-activity off 60 | set -g visual-activity off 61 | 62 | 63 | # hjkl pane traversal 64 | # set window split 65 | bind-key v split-window -h 66 | bind-key b split-window 67 | 68 | bind h select-pane -L 69 | bind j select-pane -D 70 | bind k select-pane -U 71 | bind l select-pane -R 72 | 73 | # Vi copypaste mode 74 | set-window-option -g mode-keys vi 75 | if-shell "test '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -ge 4 \)'" 'bind-key -Tcopy-mode-vi v send -X begin-selection; bind-key -Tcopy-mode-vi y send -X copy-selection-and-cancel' 76 | if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -lt 4\) -o #{$TMUX_VERSION_MAJOR} -le 1' 'bind-key -t vi-copy v begin-selection; bind-key -t vi-copy y copy-selection' 77 | 78 | # Colors 79 | set -g default-terminal "screen-256color" 80 | -------------------------------------------------------------------------------- /nvim/lua/shxfee/plugins/colorscheme.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "folke/tokyonight.nvim", 4 | lazy = false, 5 | enabled = true, 6 | priority = 1000, 7 | opts = { 8 | style = "moon", 9 | transparent = true, 10 | styles = { 11 | comments = { italic = true }, 12 | keywords = { italic = true }, 13 | sidebars = "transparent", 14 | floats = "transparent", 15 | }, 16 | sidebars = {}, 17 | }, 18 | config = function (_, opts) 19 | require("tokyonight").setup(opts) 20 | vim.cmd.colorscheme("tokyonight") 21 | end, 22 | }, 23 | 24 | { 25 | "andersevenrud/nordic.nvim", 26 | enabled = false, 27 | priority = 1000, 28 | branch = "feat/transparent-bg", 29 | config = function () 30 | vim.g.nord_transparent_backgrounds = true 31 | vim.g.nord_underline_option = 'none' 32 | vim.g.nord_italic = false 33 | vim.g.nord_italic_comments = false 34 | vim.g.nord_minimal_mode = false 35 | vim.g.nord_alternate_backgrounds = false 36 | 37 | vim.cmd([[colorscheme nordic]]) 38 | end 39 | }, 40 | 41 | { 42 | "catppuccin/nvim", 43 | name = "catppuccin", 44 | enabled = false, 45 | lazy = true, 46 | priority = 1000, 47 | config = function() 48 | require("catppuccin").setup({ 49 | flavour = "mocha", -- latte, frappe, macchiato, mocha 50 | background = { -- :h background 51 | light = "latte", 52 | dark = "mocha", 53 | }, 54 | transparent_background = true, 55 | show_end_of_buffer = false, -- show the '~' characters after the end of buffers 56 | term_colors = false, 57 | dim_inactive = { 58 | enabled = false, 59 | shade = "dark", 60 | percentage = 0.15, 61 | }, 62 | no_italic = false, -- Force no italic 63 | no_bold = false, -- Force no bold 64 | styles = { 65 | comments = { "italic" }, 66 | conditionals = {}, 67 | loops = {}, 68 | functions = {}, 69 | keywords = {}, 70 | strings = {}, 71 | variables = {}, 72 | numbers = {}, 73 | booleans = {}, 74 | properties = {}, 75 | types = {}, 76 | operators = {}, 77 | }, 78 | color_overrides = {}, 79 | custom_highlights = {}, 80 | integrations = { 81 | cmp = true, 82 | gitsigns = true, 83 | nvimtree = true, 84 | telescope = true, 85 | notify = true, 86 | mini = false, 87 | -- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations) 88 | }, 89 | }) 90 | 91 | -- setup must be called before loading 92 | vim.cmd.colorscheme "catppuccin" 93 | end 94 | }, 95 | } 96 | -------------------------------------------------------------------------------- /nvim/lua/shxfee/plugins/etc/telescope.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "telescope.nvim", 4 | version = false, 5 | dependencies = { 6 | "nvim-lua/plenary.nvim", 7 | "nvim-telescope/telescope-fzy-native.nvim", 8 | "nvim-telescope/telescope-live-grep-args.nvim", 9 | }, 10 | 11 | opts = { 12 | defaults = { 13 | layout_config = { 14 | preview_width = 0.6, 15 | }, 16 | path_display = { 17 | truncate = 3, 18 | }, 19 | }, 20 | pickers = { 21 | find_files = { 22 | mappings = { 23 | n = { 24 | ["kj"] = "close", 25 | }, 26 | }, 27 | }, 28 | }, 29 | }, 30 | 31 | config = function(_, opts) 32 | require("telescope").setup(opts) 33 | require('telescope').load_extension('fzy_native') 34 | require("telescope").load_extension("live_grep_args") 35 | end, 36 | 37 | keys = { 38 | { 39 | "fc", 40 | function() 41 | return require("telescope.builtin").find_files({ 42 | cwd = vim.fn.stdpath("config"), 43 | }) 44 | end, 45 | desc = "Find a Config File", 46 | }, 47 | { 48 | "fd", 49 | function() 50 | return require("telescope.builtin").find_files({ 51 | -- find directories using fd ignoring .git 52 | find_command = { "fd", "--type", "d", "--hidden", "--exclude", ".git" }, 53 | previewer = false, 54 | }) 55 | end, 56 | desc = "Find a Directory", 57 | }, 58 | { 59 | "ff", 60 | function() 61 | return require("telescope.builtin").find_files() 62 | end, 63 | desc = "Find a File", 64 | }, 65 | { 66 | "fg", 67 | function() 68 | return require("telescope").extensions.live_grep_args.live_grep_args() 69 | end, 70 | desc = "Live grep", 71 | }, 72 | { 73 | "fh", 74 | function() 75 | return require("telescope.builtin").help_tags() 76 | end, 77 | desc = "Find a Help Tag", 78 | }, 79 | { 80 | "fH", 81 | function() 82 | return require("telescope.builtin").highlights() 83 | end, 84 | desc = "Find a Hightlight Group", 85 | }, 86 | { 87 | "fk", 88 | function() 89 | return require("telescope.builtin").keymaps() 90 | end, 91 | desc = "Find a keymap", 92 | }, 93 | { 94 | "fp", 95 | function() 96 | return require("telescope.builtin").find_files({ 97 | find_command = { "fd", "--type", "d" }, 98 | cwd = vim.fn.stdpath("data") .. "/lazy/", 99 | previewer = false, 100 | }) 101 | end, 102 | desc = "Find a Plugin File", 103 | }, 104 | { 105 | "fr", 106 | function() 107 | return require("telescope.builtin").resume() 108 | end, 109 | desc = "Find Resume Last Search", 110 | }, 111 | }, 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /emacs/init.el: -------------------------------------------------------------------------------- 1 | ;; Emacs Configuration 2 | ;; @author 3 | 4 | ;; ======================================== 5 | ;; PACKAGES 6 | ;; ======================================== 7 | (require 'package) 8 | (add-to-list 'package-archives 9 | '("melpa" . "https://melpa.org/packages/")) 10 | (package-initialize) 11 | 12 | (unless (package-installed-p 'use-package) 13 | (package-refresh-contents) 14 | (package-install 'use-package)) 15 | 16 | (eval-when-compile (require 'use-package)) 17 | (setq use-package-always-ensure t) 18 | 19 | (use-package evil 20 | :init 21 | (setq evil-want-C-u-scroll t) 22 | (setq evil-want-C-w-in-emacs-state t) 23 | :config 24 | (define-key evil-normal-state-map (kbd "-") 'dired-jump) 25 | (evil-mode 1)) 26 | 27 | (use-package projectile 28 | :init 29 | (setq helm-projectile-fuzzy-match nil) 30 | :config 31 | (projectile-mode +1) 32 | (define-key projectile-mode-map (kbd "s-p") 'projectile-command-map) 33 | (define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map) 34 | (use-package helm-projectile 35 | :config 36 | (helm-projectile-on))) 37 | 38 | (use-package fzf) 39 | 40 | 41 | (use-package php-mode 42 | :init 43 | (add-hook 'php-mode-hook 44 | '(lambda () 45 | (auto-complete-mode t) 46 | 47 | (use-package ac-php) 48 | (setq ac-sources '(ac-source-php)) 49 | 50 | (yas-global-mode 1) 51 | (ac-php-core-eldoc-setup) 52 | 53 | (define-key php-mode-map (kbd "M-]") 54 | 'ac-php-find-symbol-at-point) 55 | 56 | (define-key php-mode-map (kbd "M-[") 57 | 'ac-php-location-stack-back))) 58 | ) 59 | 60 | (use-package jbeans-theme 61 | :config 62 | (load-theme 'jbeans t)) 63 | 64 | (use-package helm 65 | :init 66 | (setq-default helm-M-x-fuzzy-match t) 67 | :bind 68 | (("M-x" . helm-M-x) 69 | ("M-f" . helm-find-files)) 70 | :config 71 | (helm-mode 1)) 72 | 73 | (use-package helm-fd 74 | :bind (:map helm-command-map 75 | ("/" . helm-fd))) 76 | 77 | (use-package auto-complete 78 | :config 79 | (ac-config-default)) 80 | 81 | (use-package ls-lisp 82 | :ensure nil 83 | :init 84 | (setq ls-lisp-dirs-first t) 85 | (setq ls-lisp-use-insert-directory-program nil)) 86 | 87 | (use-package dired-x :ensure nil) 88 | 89 | ;; ======================================== 90 | ;; KEY BINDINGS 91 | ;; ======================================== 92 | (global-set-key (kbd "C-x .") (lambda() (interactive)(find-file "~/.emacs.d/init.el"))) 93 | 94 | 95 | ;; ======================================== 96 | ;; HOOKS 97 | ;; ======================================== 98 | (add-hook 'dired-mode-hook 99 | (lambda () 100 | (local-set-key (kbd "-") 'dired-up-directory) 101 | (dired-hide-details-mode))) 102 | 103 | 104 | ;; ======================================== 105 | ;; Config Vars 106 | ;; ======================================== 107 | (menu-bar-mode -1) 108 | (global-display-line-numbers-mode) 109 | 110 | (require 'hl-line) 111 | (set-face-attribute 'hl-line nil :inherit nil :background "color-234") 112 | 113 | (global-hl-line-mode 1) 114 | 115 | (setq initial-buffer-choice t) 116 | 117 | (setq 118 | scroll-step 1 119 | scroll-conservatively 10000) 120 | 121 | (custom-set-variables 122 | ;; custom-set-variables was added by Custom. 123 | ;; If you edit it by hand, you could mess it up, so be careful. 124 | ;; Your init file should contain only one such instance. 125 | ;; If there is more than one, they won't work right. 126 | '(package-selected-packages 127 | (quote 128 | (helm-fd ac-php php-mode web-mode use-package projectile jbeans-theme helm evil auto-complete)))) 129 | (custom-set-faces 130 | ;; custom-set-faces was added by Custom. 131 | ;; If you edit it by hand, you could mess it up, so be careful. 132 | ;; Your init file should contain only one such instance. 133 | ;; If there is more than one, they won't work right. 134 | ) 135 | -------------------------------------------------------------------------------- /nvim/lua/shxfee/plugins/ui.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- notifications 3 | { 4 | "rcarriga/nvim-notify", 5 | keys = { 6 | { 7 | "uu", 8 | function() 9 | require("notify").dismiss({ silent = true, pending = true }) 10 | end, 11 | desc = "clear notifications", 12 | }, 13 | { 14 | "un", 15 | "Notifications", 16 | desc = "show notifications", 17 | }, 18 | }, 19 | opts = { 20 | timeout = 3000, 21 | max_height = function() 22 | return math.floor(vim.o.lines * 0.75) 23 | end, 24 | max_width = function() 25 | return math.floor(vim.o.columns * 0.75) 26 | end, 27 | stages = "static", 28 | }, 29 | init = function() 30 | vim.notify = require("notify") 31 | end, 32 | }, 33 | 34 | -- statusline 35 | { 36 | "nvim-lualine/lualine.nvim", 37 | event = "VeryLazy", 38 | opts = function() 39 | return { 40 | options = { 41 | theme = "auto", 42 | globalstatus = true, 43 | disabled_filetypes = { statusline = { "lazy", "mason" } }, 44 | }, 45 | sections = { 46 | lualine_a = { 47 | { 48 | "mode", 49 | color = { gui = 'none' }, 50 | fmt = function(mode) 51 | return mode:lower() 52 | end, 53 | } 54 | }, 55 | lualine_b = { "branch" }, 56 | lualine_c = { 57 | { "filename", path = 1, symbols = { modified = "", readonly = "", unnamed = "" } }, 58 | }, 59 | 60 | lualine_x = { 61 | { "diagnostics" }, 62 | }, 63 | 64 | lualine_y = { 65 | { "filetype", icon_only = false, padding = { left = 1, right = 1 } }, 66 | }, 67 | 68 | lualine_z = { 69 | { "progress", padding = { left = 1, right = 1 } }, 70 | }, 71 | }, 72 | } 73 | end, 74 | }, 75 | 76 | -- indent guides 77 | { 78 | "lukas-reineke/indent-blankline.nvim", 79 | main = "ibl", 80 | opts = { 81 | indent = { 82 | char = "│", 83 | }, 84 | scope = { 85 | show_start = false, 86 | show_end = false, 87 | }, 88 | }, 89 | }, 90 | 91 | -- icons 92 | { 93 | "kyazdani42/nvim-web-devicons", 94 | event = "VeryLazy", 95 | }, 96 | 97 | -- folding 98 | { 99 | "kevinhwang91/nvim-ufo", 100 | keys = { 101 | {"z"}, 102 | { 103 | "zR", 104 | "lua require('ufo').openAllFolds()", 105 | desc = "open all folds", 106 | mode = "n", 107 | }, 108 | { 109 | "zM", 110 | "lua require('ufo').closeAllFolds()", 111 | desc = "close all folds", 112 | mode = "n", 113 | }, 114 | }, 115 | dependencies = { 116 | "kevinhwang91/promise-async", 117 | }, 118 | config = function() 119 | vim.o.foldcolumn = "0" 120 | vim.o.foldlevel = 99 121 | vim.o.foldlevelstart = 99 122 | vim.o.foldenable = true 123 | 124 | require("ufo").setup() 125 | end 126 | }, 127 | 128 | 129 | -- UI for nvim-lsp progress 130 | { 131 | "j-hui/fidget.nvim", 132 | tag = "legacy", 133 | event = "LspAttach", 134 | opts = { 135 | window = { 136 | relative = "editor", 137 | blend = 0, 138 | }, 139 | text = { 140 | spinner = "dots", 141 | }, 142 | }, 143 | }, 144 | 145 | -- Transparency 146 | { 147 | "xiyaowong/transparent.nvim", 148 | config = function() 149 | require("transparent").setup({ 150 | extra_groups = { 151 | "NormalFloat", 152 | "FloatBorder", 153 | "Float", 154 | "GitSignsAdd", 155 | "GitSignsChange", 156 | "GitSignsDelete", 157 | "Pmenu", 158 | "WinSeparator", 159 | "TelescopeNormal", 160 | "TelescopeBorder", 161 | "TelescopeSelection", 162 | "TelescopePreviewNormal", 163 | "WhichKeyFloat", 164 | "CmpItemMenu", 165 | }, 166 | }) 167 | end, 168 | }, 169 | } 170 | -------------------------------------------------------------------------------- /nvim/lua/shxfee/plugins/lsp/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "neovim/nvim-lspconfig", 4 | dependencies = { 5 | "williamboman/mason.nvim", 6 | "williamboman/mason-lspconfig.nvim", 7 | "folke/lazydev.nvim", 8 | "hrsh7th/cmp-nvim-lsp", 9 | }, 10 | 11 | config = function() 12 | require("mason").setup({ ui = { border = 'rounded' } }) 13 | require("mason-lspconfig").setup({ automatic_installation = true, }) 14 | require("lazydev").setup() 15 | 16 | vim.diagnostic.config({ 17 | underline = false, 18 | virtual_text = false, 19 | float = { 20 | source = 'if_many', 21 | border = 'rounded', 22 | focusable = false, 23 | }, 24 | update_in_insert = true, 25 | severity_sort = true, 26 | signs = { 27 | text = { 28 | [vim.diagnostic.severity.ERROR] = '', 29 | [vim.diagnostic.severity.WARN] = '', 30 | [vim.diagnostic.severity.HINT] = '', 31 | [vim.diagnostic.severity.INFO] = '', 32 | } 33 | } 34 | }) 35 | 36 | local capabilities = nil 37 | if pcall(require, "cmp_nvim_lsp") then 38 | capabilities = require("cmp_nvim_lsp").default_capabilities() 39 | end 40 | 41 | local lspconfig = require "lspconfig" 42 | 43 | local servers = { 44 | diagnosticls = true, 45 | bashls = true, 46 | lua_ls = true, 47 | intelephense = true, 48 | 49 | tailwindcss = true, 50 | cssls = true, 51 | html = true, 52 | jsonls = true, 53 | volar = true, 54 | tsserver = true, 55 | } 56 | 57 | 58 | local handlers = { 59 | ["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = 'rounded' }), 60 | ["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = 'rounded' }), 61 | } 62 | 63 | for name, config in pairs(servers) do 64 | if config == true then 65 | config = {} 66 | end 67 | config = vim.tbl_deep_extend("force", {}, { 68 | capabilities = capabilities, 69 | handlers = handlers, 70 | }, config) 71 | 72 | lspconfig[name].setup(config) 73 | end 74 | 75 | local disable_semantic_tokens = { 76 | lua = true, 77 | } 78 | 79 | vim.api.nvim_create_autocmd("LspAttach", { 80 | callback = function(args) 81 | local bufnr = args.buf 82 | local client = assert(vim.lsp.get_client_by_id(args.data.client_id), "must have valid client") 83 | 84 | local settings = servers[client.name] 85 | if type(settings) ~= "table" then 86 | settings = {} 87 | end 88 | 89 | local builtin = require "telescope.builtin" 90 | 91 | vim.opt_local.omnifunc = "v:lua.vim.lsp.omnifunc" 92 | vim.keymap.set("n", "gd", builtin.lsp_definitions, { buffer = 0 }) 93 | vim.keymap.set("n", "gD", vim.lsp.buf.declaration, { buffer = 0 }) 94 | vim.keymap.set("n", "gr", builtin.lsp_references, { buffer = 0 }) 95 | vim.keymap.set("n", "gT", vim.lsp.buf.type_definition, { buffer = 0 }) 96 | vim.keymap.set("n", "K", vim.lsp.buf.hover, { buffer = 0 }) 97 | vim.keymap.set('n', '', vim.lsp.buf.signature_help, { buffer = 0 }) 98 | vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { buffer = 0 }) 99 | vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { buffer = 0 }) 100 | 101 | -- vim.keymap.set("n", "cr", vim.lsp.buf.rename, { buffer = 0 }) 102 | -- vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { buffer = 0 }) 103 | 104 | local filetype = vim.bo[bufnr].filetype 105 | if disable_semantic_tokens[filetype] then 106 | client.server_capabilities.semanticTokensProvider = nil 107 | end 108 | 109 | -- Override server capabilities 110 | if settings.server_capabilities then 111 | for k, v in pairs(settings.server_capabilities) do 112 | if v == vim.NIL then 113 | ---@diagnostic disable-next-line: cast-local-type 114 | v = nil 115 | end 116 | 117 | client.server_capabilities[k] = v 118 | end 119 | end 120 | end, 121 | }) 122 | 123 | end, 124 | }, 125 | } 126 | -------------------------------------------------------------------------------- /nvim/lua/shxfee/config/keymaps.lua: -------------------------------------------------------------------------------- 1 | local keymap = vim.keymap 2 | local wk = require("which-key") 3 | 4 | -- leader mappings 5 | wk.add({ 6 | -- artisan 7 | { "a", group = "application" }, 8 | { 9 | "aa", 10 | function() 11 | local cmd = ":T ./vendor/bin/sail artisan " 12 | vim.api.nvim_feedkeys(cmd, "n", true) 13 | end, 14 | desc = "artisan", 15 | }, 16 | { 17 | "as", 18 | function() 19 | local cmd = ":T ./vendor/bin/sail " 20 | vim.api.nvim_feedkeys(cmd, "n", true) 21 | end, 22 | desc = "sail", 23 | }, 24 | 25 | { "am", group = "migrate" }, 26 | { "amf", "T ./vendor/bin/sail artisan migrate:fresh --seed", desc = "fresh" }, 27 | 28 | -- configuration 29 | { "c", group = "config" }, 30 | { 31 | "ca", 32 | function () 33 | local config_dir = vim.fn.stdpath("config") 34 | vim.cmd.edit(config_dir .. "/lua/shxfee/config/autocmds.lua") 35 | end, 36 | desc = "auto commands", 37 | }, 38 | { 39 | "cA", 40 | function () 41 | local config_dir = vim.fn.stdpath("config") 42 | vim.cmd.edit(config_dir .. "/lua/shxfee/config/abbreviations.lua") 43 | end, 44 | desc = "abbreviations", 45 | }, 46 | { 47 | "cd", 48 | function () 49 | local config_dir = vim.fn.stdpath("config") 50 | vim.cmd.edit(config_dir) 51 | end, 52 | desc = "directory", 53 | }, 54 | { 55 | "cf", 56 | function () 57 | require("telescope.builtin").find_files({ 58 | prompt_title = "Config Files", 59 | cwd = vim.fn.stdpath("config"), 60 | }) 61 | end, 62 | desc = "files", 63 | }, 64 | { 65 | "ck", 66 | function () 67 | require("telescope.builtin").keymaps() 68 | end, 69 | desc = "keymaps", 70 | }, 71 | { "cl", "Lazy", desc = "lazy" }, 72 | { "cm", "Mason", desc = "mason LSP manager" }, 73 | { 74 | "co", 75 | function () 76 | local config_dir = vim.fn.stdpath("config") 77 | vim.cmd.edit(config_dir .. "/lua/shxfee/config/options.lua") 78 | end, 79 | desc = "options", 80 | }, 81 | 82 | -- telescope 83 | { "f", group = "find" }, 84 | { "g", group = "git" }, 85 | { "t", group = "test" }, 86 | { "u", group = "ui" }, 87 | { "wc", "wall | only | enew", desc = "clear" }, 88 | }) 89 | 90 | 91 | -- other mappings 92 | -- easier command history navigation 93 | keymap.set("c", "", "") 94 | keymap.set("c", "", "") 95 | 96 | -- escape terminal mode with 97 | keymap.set("t", "", "") 98 | 99 | -- copy paste from system clipboard 100 | keymap.set("v", "", '"+y') 101 | keymap.set("n", "", '"+]p') 102 | keymap.set("v", "", '"+]p') 103 | keymap.set("i", "", "+") 104 | 105 | -- paste last yanked text 106 | keymap.set("n", "gp", '"0p', { desc = "Paste Last Yanked Text" }) 107 | 108 | -- open links in browser 109 | keymap.set( 110 | "n", "gl", 111 | [[:execute '!wslview ' . shellescape(expand(''), 1)]], 112 | { silent = true } 113 | ) 114 | 115 | -- better up/down 116 | keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) 117 | keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) 118 | 119 | -- always search forward with n and back with N 120 | -- https://github.com/mhinz/vim-galore#saner-behavior-of-n-and-n 121 | keymap.set("n", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" }) 122 | keymap.set("x", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" }) 123 | keymap.set("o", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" }) 124 | keymap.set("n", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" }) 125 | keymap.set("x", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" }) 126 | keymap.set("o", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" }) 127 | 128 | -- save file in all modes 129 | keymap.set({ "i", "v", "n", "s" }, "", "w", { desc = "Save file" }) 130 | keymap.set({ "n" }, "", "q", { desc = "Save file" }) 131 | 132 | keymap.set({ "n" }, "", function () 133 | vim.cmd.nohlsearch() 134 | vim.cmd.diffupdate() 135 | vim.cmd.redraw() 136 | 137 | -- refresh indent lines 138 | if vim.g.indent_blankline_enabled then 139 | vim.cmd("IndentBlanklineRefresh") 140 | end 141 | end, { desc = "Clear search highlight" }) 142 | -------------------------------------------------------------------------------- /nvim/lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, 3 | "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, 4 | "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, 5 | "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, 6 | "cmp-spell": { "branch": "master", "commit": "694a4e50809d6d645c1ea29015dad0c293f019d6" }, 7 | "copilot.lua": { "branch": "master", "commit": "86537b286f18783f8b67bccd78a4ef4345679625" }, 8 | "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, 9 | "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, 10 | "gitsigns.nvim": { "branch": "main", "commit": "f4928ba14eb6c667786ac7d69927f6aee6719f1e" }, 11 | "gp.nvim": { "branch": "main", "commit": "9fcd990468bd109baf14665f565f42aec2355772" }, 12 | "indent-blankline.nvim": { "branch": "master", "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" }, 13 | "lazy.nvim": { "branch": "main", "commit": "839f9e78e78dc935b1188fb16583365991739c51" }, 14 | "lazydev.nvim": { "branch": "main", "commit": "491452cf1ca6f029e90ad0d0368848fac717c6d2" }, 15 | "leap.nvim": { "branch": "main", "commit": "a9a9faee45066f2796c9a0e0ef52bf571d144492" }, 16 | "lualine.nvim": { "branch": "master", "commit": "544dd1583f9bb27b393f598475c89809c4d5e86b" }, 17 | "markdown.nvim": { "branch": "main", "commit": "5e4e33102b784353998c83d57dbacea4db71d55b" }, 18 | "mason-lspconfig.nvim": { "branch": "main", "commit": "58bc9119ca273c0ce5a66fad1927ef0f617bd81b" }, 19 | "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, 20 | "nordic.nvim": { "branch": "feat/transparent-bg", "commit": "3338c514e5b5feade29a9c2ed295c9f034f7f05b" }, 21 | "nvim-autopairs": { "branch": "master", "commit": "78a4507bb9ffc9b00f11ae0ac48243d00cb9194d" }, 22 | "nvim-cmp": { "branch": "main", "commit": "d818fd0624205b34e14888358037fb6f5dc51234" }, 23 | "nvim-colorizer.lua": { "branch": "master", "commit": "08bd34bf0ed79723f62764c7f9ca70516d461d0d" }, 24 | "nvim-lspconfig": { "branch": "master", "commit": "fa6c2a64100c6f692bbec29bbbc8ec2663c9e869" }, 25 | "nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" }, 26 | "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, 27 | "nvim-treesitter": { "branch": "master", "commit": "debf5816eee21b7d51025ef17ba0647386226cb5" }, 28 | "nvim-ts-autotag": { "branch": "main", "commit": "1624866a1379fc1861797f0ed05899a9c1d2ff61" }, 29 | "nvim-ts-context-commentstring": { "branch": "main", "commit": "6b5f95aa4d24f2c629a74f2c935c702b08dbde62" }, 30 | "nvim-ufo": { "branch": "main", "commit": "1b5f2838099f283857729e820cc05e2b19df7a2c" }, 31 | "nvim-web-devicons": { "branch": "master", "commit": "e612de3d3a41a6b7be47f51e956dddabcbf419d9" }, 32 | "oil.nvim": { "branch": "master", "commit": "fcca212c2e966fc3dec1d4baf888e670631d25d1" }, 33 | "php.vim": { "branch": "master", "commit": "930aec5c7026297a6630bd2940c08c5ff552cf2a" }, 34 | "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, 35 | "promise-async": { "branch": "main", "commit": "28c1d5a295eb5310afa2523d4ae9aa41ec5a9de2" }, 36 | "tabular": { "branch": "master", "commit": "12437cd1b53488e24936ec4b091c9324cafee311" }, 37 | "telescope-fzy-native.nvim": { "branch": "master", "commit": "282f069504515eec762ab6d6c89903377252bf5b" }, 38 | "telescope-live-grep-args.nvim": { "branch": "master", "commit": "8ad632f793fd437865f99af5684f78300dac93fb" }, 39 | "telescope.nvim": { "branch": "master", "commit": "79552ef8488cb492e0f9d2bf3b4e808f57515e35" }, 40 | "tokyonight.nvim": { "branch": "main", "commit": "a487cac3113adb1853e3a81060f51d7a391cdea9" }, 41 | "transparent.nvim": { "branch": "main", "commit": "fd35a46f4b7c1b244249266bdcb2da3814f01724" }, 42 | "treesj": { "branch": "main", "commit": "275f83c81a5a1f5ae23c1eac30c4ac28beebbca2" }, 43 | "vim-abolish": { "branch": "master", "commit": "dcbfe065297d31823561ba787f51056c147aa682" }, 44 | "vim-blade": { "branch": "master", "commit": "9534101808cc320eef003129a40cab04b026a20c" }, 45 | "vim-dirvish": { "branch": "master", "commit": "3851bedb7f191b9a4a5531000b6fc0a8795cc9bb" }, 46 | "vim-fugitive": { "branch": "master", "commit": "0444df68cd1cdabc7453d6bd84099458327e5513" }, 47 | "vim-test": { "branch": "master", "commit": "34aab77f7a63f20a623df45684156915f6182a55" }, 48 | "vim-wakatime": { "branch": "master", "commit": "53bba6bb8342de9cbdafc82142a9b5e82008d858" }, 49 | "which-key.nvim": { "branch": "main", "commit": "48cdaaab93a4c85cac8eb271bb48307ed337787f" } 50 | } 51 | -------------------------------------------------------------------------------- /nvim/lua/shxfee/plugins/temp.lua.bak: -------------------------------------------------------------------------------- 1 | return { 2 | -- simple todo 3 | { 4 | "nocksock/do.nvim", 5 | opts = { 6 | message_timeout = 2000, -- how long notifications are shown 7 | kaomoji_mode = 0, -- 0 kaomoji everywhere, 1 skip kaomoji in doing 8 | winbar = true, 9 | doing_prefix = "Doing: ", 10 | store = { 11 | auto_create_file = true, -- automatically create a .do_tasks when calling :Do 12 | file_name = ".do_tasks", 13 | } 14 | }, 15 | cmd = { "Do", "DoEdit", "DoShow" }, 16 | }, 17 | 18 | -- duck 19 | { 20 | "tamton-aquib/duck.nvim", 21 | name = "duck", 22 | keys = { 23 | { 24 | "ud", 25 | function () 26 | require("duck").hatch("🦀", 0.75) 27 | end 28 | }, 29 | }, 30 | }, 31 | 32 | -- refactoring code 33 | { 34 | "ThePrimeagen/refactoring.nvim", 35 | dependencies = { 36 | "nvim-lua/plenary.nvim", 37 | "nvim-treesitter", 38 | }, 39 | keys = { 40 | { 41 | "re", 42 | [[ lua require('refactoring').refactor('Extract Function')]], 43 | mode = "v", 44 | desc = "Extract function" 45 | }, 46 | { 47 | "rf", 48 | [[ lua require('refactoring').refactor('Extract Function To File')]], 49 | mode = "v", 50 | desc = "Extract function to file", 51 | }, 52 | { 53 | "rv", 54 | [[ lua require('refactoring').refactor('Extract Variable')]], 55 | mode = "v", 56 | desc = "Extract variable", 57 | }, 58 | { 59 | "ri", 60 | [[ lua require('refactoring').refactor('Inline Variable')]], 61 | mode = "v", 62 | desc = "Inline variable", 63 | }, 64 | } 65 | }, 66 | 67 | -- bracket navigation 68 | { 69 | 'echasnovski/mini.bracketed', 70 | enabled = true, 71 | event = "VeryLazy", 72 | version = false, 73 | config = function () 74 | require("mini.bracketed").setup() 75 | end 76 | }, 77 | 78 | -- fuzzy finder 2.0 79 | { 80 | "ibhagwan/fzf-lua", 81 | enabled = true, 82 | dependencies = { 'nvim-web-devicons' }, 83 | opts = { 84 | files = { 85 | git_icons = false, 86 | }, 87 | }, 88 | keys = { 89 | { 90 | "pp", 91 | function() 92 | return require("fzf-lua").files() 93 | end, 94 | desc = "Find a File", 95 | }, 96 | { 97 | "pd", 98 | function() 99 | return require("fzf-lua").files({ 100 | -- find directories using fd ignoring .git 101 | cmd = "fd --type d --hidden --exclude .git", 102 | }) 103 | end, 104 | desc = "Find a Directory", 105 | }, 106 | }, 107 | }, 108 | 109 | -- orgmode 110 | { 111 | "nvim-orgmode/orgmode", 112 | build = function() 113 | require('orgmode').setup_ts_grammar() 114 | vim.cmd("TSUpdate org") 115 | end, 116 | dependencies = { 117 | { 118 | "nvim-treesitter", 119 | opts = function(_, opts) 120 | local newOpts = { 121 | highlight = { 122 | additional_vim_regex_highlighting = { 'org' } 123 | }, 124 | ensure_installed = { 'org' }, 125 | } 126 | 127 | return vim.tbl_deep_extend("force", opts, newOpts) 128 | end, 129 | }, 130 | { 131 | "nvim-cmp", 132 | opts = function(_, opts) 133 | local newOpts = { 134 | sources = { 135 | { name = 'orgmode' }, 136 | }, 137 | } 138 | 139 | return vim.tbl_deep_extend("force", opts, newOpts) 140 | end, 141 | }, 142 | }, 143 | opts = { 144 | org_agenda_files = { '~/documents/org/*' }, 145 | org_default_notes_file = '~/documents/org/refile.org', 146 | }, 147 | config = function(_, opts) 148 | local org = require('orgmode') 149 | 150 | org.setup_ts_grammar() 151 | org.setup(opts) 152 | end, 153 | }, 154 | 155 | -- dashboard 156 | { 157 | "glepnir/dashboard-nvim", 158 | enabled = false, 159 | config = function() 160 | require("dashboard").setup { 161 | theme = "doom", 162 | config = { 163 | header = { 164 | "", 165 | "", 166 | " ⣿⣿⣷⡁⢆⠈⠕⢕⢂⢕⢂⢕⢂⢔⢂⢕⢄⠂⣂⠂⠆⢂⢕⢂⢕⢂⢕⢂⢕⢂ ", 167 | " ⣿⣿⣿⡷⠊⡢⡹⣦⡑⢂⢕⢂⢕⢂⢕⢂⠕⠔⠌⠝⠛⠶⠶⢶⣦⣄⢂⢕⢂⢕ ", 168 | " ⣿⣿⠏⣠⣾⣦⡐⢌⢿⣷⣦⣅⡑⠕⠡⠐⢿⠿⣛⠟⠛⠛⠛⠛⠡⢷⡈⢂⢕⢂ ", 169 | " ⠟⣡⣾⣿⣿⣿⣿⣦⣑⠝⢿⣿⣿⣿⣿⣿⡵⢁⣤⣶⣶⣿⢿⢿⢿⡟⢻⣤⢑⢂ ", 170 | " ⣾⣿⣿⡿⢟⣛⣻⣿⣿⣿⣦⣬⣙⣻⣿⣿⣷⣿⣿⢟⢝⢕⢕⢕⢕⢽⣿⣿⣷⣔ ", 171 | " ⣿⣿⠵⠚⠉⢀⣀⣀⣈⣿⣿⣿⣿⣿⣿⣿⣿⣿⣗⢕⢕⢕⢕⢕⢕⣽⣿⣿⣿⣿ ", 172 | " ⢷⣂⣠⣴⣾⡿⡿⡻⡻⣿⣿⣴⣿⣿⣿⣿⣿⣿⣷⣵⣵⣵⣷⣿⣿⣿⣿⣿⣿⡿ ", 173 | " ⢌⠻⣿⡿⡫⡪⡪⡪⡪⣺⣿⣿⣿⣿⣿⠿⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃ ", 174 | " ⠣⡁⠹⡪⡪⡪⡪⣪⣾⣿⣿⣿⣿⠋⠐⢉⢍⢄⢌⠻⣿⣿⣿⣿⣿⣿⣿⣿⠏⠈ ", 175 | " ⡣⡘⢄⠙⣾⣾⣾⣿⣿⣿⣿⣿⣿⡀⢐⢕⢕⢕⢕⢕⡘⣿⣿⣿⣿⣿⣿⠏⠠⠈ ", 176 | " ⠌⢊⢂⢣⠹⣿⣿⣿⣿⣿⣿⣿⣿⣧⢐⢕⢕⢕⢕⢕⢅⣿⣿⣿⣿⡿⢋⢜⠠⠈ ", 177 | " ⠄⠁⠕⢝⡢⠈⠻⣿⣿⣿⣿⣿⣿⣿⣷⣕⣑⣑⣑⣵⣿⣿⣿⡿⢋⢔⢕⣿⠠⠈ ", 178 | " ⠨⡂⡀⢑⢕⡅⠂⠄⠉⠛⠻⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⡿⢋⢔⢕⢕⣿⣿⠠⠈ ", 179 | " ⠄⠪⣂⠁⢕⠆⠄⠂⠄⠁⡀⠂⡀⠄⢈⠉⢍⢛⢛⢛⢋⢔⢕⢕⢕⣽⣿⣿⠠⠈ ", 180 | "", 181 | "", 182 | } 183 | } 184 | } 185 | end, 186 | }, 187 | 188 | -- treesitter playground 189 | { 190 | "nvim-treesitter/playground", 191 | cmd = "TSPlaygroundToggle", 192 | }, 193 | } 194 | -------------------------------------------------------------------------------- /nvim/lua/shxfee/plugins/coding.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- lsp more in etc 3 | { "hrsh7th/nvim-cmp" }, 4 | 5 | -- treesitter more in etc 6 | { "nvim-treesitter/nvim-treesitter" }, 7 | 8 | -- word substitutions for code cases (snake, camel, dot etc) 9 | { 10 | "tpope/vim-abolish", 11 | lazy = false, 12 | config = function () 13 | require("which-key").add({ 14 | { "cr", group = "coerse" }, 15 | { "cr-", desc = "Kebab Case (not reversible)" }, 16 | { "cr.", desc = "Dot Case (not reversible)" }, 17 | { "cr", desc = "Space Case (not reversible)" }, 18 | { "crU", desc = "Snake Upper Case" }, 19 | { "cr_", desc = "Snake Case" }, 20 | { "crc", desc = "Camel Case" }, 21 | { "crk", desc = "Kebab Case" }, 22 | { "crm", desc = "Mixed Case" }, 23 | { "crs", desc = "Snake Case" }, 24 | { "crt", desc = "Title Case (not reversible)" }, 25 | { "cru", desc = "Snake Upper Case" }, 26 | }) 27 | end 28 | }, 29 | 30 | -- git fugitive 31 | { 32 | "tpope/vim-fugitive", 33 | cmd = { 34 | "Git", 35 | "Gread", 36 | }, 37 | keys = { 38 | { 39 | "gg", 40 | "vertical Git", 41 | desc = "git status", 42 | }, 43 | { 44 | "gb", 45 | "0GlLog!", 46 | desc = "git log for buffer", 47 | }, 48 | { 49 | "gp", 50 | "Git push", 51 | desc = "git push", 52 | } 53 | }, 54 | }, 55 | 56 | -- git signs 57 | { 58 | "lewis6991/gitsigns.nvim", 59 | event = "BufReadPre", 60 | opts = function () 61 | local opts = {} 62 | 63 | -- slim │ fat ▎ 64 | local char = "│" 65 | 66 | opts["signs"] = { 67 | add = { text = char }, 68 | change = { text = char }, 69 | delete = { text = char }, 70 | topdelete = { text = char }, 71 | changedelete = { text = char }, 72 | untracked = { text = char }, 73 | } 74 | 75 | return opts 76 | end, 77 | }, 78 | 79 | -- diffview 80 | { 81 | "sindrets/diffview.nvim", 82 | dependencies = { 83 | "nvim-lua/plenary.nvim", 84 | }, 85 | cmd = "DiffviewOpen", 86 | config = true, 87 | }, 88 | 89 | -- comments 90 | { 91 | "numToStr/Comment.nvim", 92 | dependencies = { 93 | "JoosepAlviste/nvim-ts-context-commentstring", 94 | }, 95 | keys = { 96 | { 97 | "gc", 98 | mode = { "n", "v" }, 99 | desc = "Comment", 100 | }, 101 | }, 102 | opts = { 103 | pre_hook = function() 104 | require('ts_context_commentstring.integrations.comment_nvim').create_pre_hook() 105 | end, 106 | }, 107 | config = function(_, opts) 108 | require("Comment").setup(opts) 109 | end, 110 | }, 111 | 112 | -- auto pairs 113 | { 114 | "windwp/nvim-autopairs", 115 | event = "InsertEnter", 116 | opts = true, 117 | }, 118 | 119 | -- auto html tag completion 120 | { 121 | "windwp/nvim-ts-autotag", 122 | event = "InsertEnter", 123 | opts = { 124 | filetypes = { 125 | "html", 126 | "vue", 127 | "blade", 128 | }, 129 | }, 130 | }, 131 | 132 | -- tabularize lines of code 133 | { 134 | "godlygeek/tabular", 135 | cmd = "Tabularize", 136 | }, 137 | 138 | -- preview colors 139 | { 140 | "NvChad/nvim-colorizer.lua", 141 | ft = { "css", "html", "sass", "scss", "vue" }, 142 | opts = { 143 | filetypes = { 144 | '*'; 145 | '!neorg'; 146 | } 147 | }, 148 | }, 149 | 150 | -- test 151 | { 152 | "janko-m/vim-test", 153 | init = function() 154 | vim.g["test#strategy"] = "neovim" 155 | vim.g["test#neovim#term_position"] = "split" 156 | vim.g["test#php#phpunit#executable"] = "./vendor/bin/phpunit" 157 | end, 158 | keys = { 159 | { 160 | "tt", 161 | function () 162 | require("shxfee.utils").run_nearest_or_last_test() 163 | end, 164 | desc = "Run the current test case", 165 | }, 166 | { 167 | "tf", 168 | "TestFile", 169 | desc = "Run all tests in file", 170 | }, 171 | { 172 | "tl", 173 | "TestLast", 174 | desc = "Run last test", 175 | }, 176 | { 177 | "ts", 178 | "TestSuite", 179 | desc = "Run test suite", 180 | }, 181 | }, 182 | }, 183 | 184 | -- keeping track of time 185 | { 186 | "wakatime/vim-wakatime", 187 | }, 188 | 189 | -- copilot lua 190 | { 191 | "zbirenbaum/copilot.lua", 192 | enabled = true, 193 | event = "InsertEnter", 194 | opts = { 195 | suggestion = { 196 | auto_trigger = true, 197 | keymap = { 198 | accept = "", 199 | accept_line = "", 200 | accept_word = "", 201 | next = "", 202 | prev = "", 203 | dismiss = "", 204 | }, 205 | }, 206 | }, 207 | }, 208 | 209 | { 210 | "robitx/gp.nvim", 211 | opts = { 212 | providers = { 213 | openai = { disabled = true }, 214 | copilot = { disabled = false }, 215 | } 216 | }, 217 | keys = { 218 | { "c", "GpChatNew", "New GPT" }, 219 | { "v", "GpChatNew vsplit", "New GPT vsplit" }, 220 | }, 221 | }, 222 | 223 | -- split/join code blocks 224 | { 225 | "Wansmer/treesj", 226 | opts = { 227 | use_default_keymaps = false, 228 | max_join_length = 200, 229 | }, 230 | keys = { 231 | { "gs", "TSJSplit", "Split Code" }, 232 | { "gj", "TSJJoin", "Join Code" }, 233 | }, 234 | }, 235 | 236 | -- Syntax and indent files 237 | -- loading this on ft because that seems to work better for some reason 238 | -- otherwise indents for example only work after set ft=blade 239 | -- blade 240 | { 241 | "jwalton512/vim-blade", 242 | ft = "blade", 243 | }, 244 | 245 | -- php 246 | { 247 | "StanAngeloff/php.vim", 248 | ft = "php", 249 | }, 250 | 251 | -- vue 252 | { 253 | -- "posva/vim-vue", 254 | "leafOfTree/vim-vue-plugin", 255 | enabled = false, 256 | ft = "vue", 257 | }, 258 | } 259 | -------------------------------------------------------------------------------- /fish/conf.d/nix-env.fish: -------------------------------------------------------------------------------- 1 | # Setup Nix 2 | 3 | # We need to distinguish between single-user and multi-user installs. 4 | # This is difficult because there's no official way to do this. 5 | # We could look for the presence of /nix/var/nix/daemon-socket/socket but this will fail if the 6 | # daemon hasn't started yet. /nix/var/nix/daemon-socket will exist if the daemon has ever run, but 7 | # I don't think there's any protection against accidentally running `nix-daemon` as a user. 8 | # We also can't just look for /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh because 9 | # older single-user installs used the default profile instead of a per-user profile. 10 | # We can still check for it first, because all multi-user installs should have it, and so if it's 11 | # not present that's a pretty big indicator that this is a single-user install. If it does exist, 12 | # we still need to verify the install type. To that end we'll look for a root owner and sticky bit 13 | # on /nix/store. Multi-user installs set both, single-user installs don't. It's certainly possible 14 | # someone could do a single-user install as root and then manually set the sticky bit but that 15 | # would be extremely unusual. 16 | 17 | set -l nix_profile_path /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh 18 | set -l single_user_profile_path ~/.nix-profile/etc/profile.d/nix.sh 19 | if test -e $nix_profile_path 20 | # The path exists. Double-check that this is a multi-user install. 21 | # We can't just check for ~/.nix-profile/… because this may be a single-user install running as 22 | # the wrong user. 23 | 24 | # stat is not portable. Splitting the output of ls -nd is reliable on most platforms. 25 | set -l owner (string split -n ' ' (ls -nd /nix/store 2>/dev/null))[3] 26 | if not test -k /nix/store -a $owner -eq 0 27 | # /nix/store is either not owned by root or not sticky. Assume single-user. 28 | set nix_profile_path $single_user_profile_path 29 | end 30 | else 31 | # The path doesn't exist. Assume single-user 32 | set nix_profile_path $single_user_profile_path 33 | end 34 | 35 | if test -e $nix_profile_path 36 | # Source the nix setup script 37 | # We're going to run the regular Nix profile under bash and then print out a few variables 38 | for line in (env -u BASH_ENV bash -c '. "$0"; for name in PATH "${!NIX_@}"; do printf "%s=%s\0" "$name" "${!name}"; done' $nix_profile_path | string split0) 39 | set -xg (string split -m 1 = $line) 40 | end 41 | 42 | # Insert Nix's fish share directories into fish's special variables. 43 | # nixpkgs-installed fish tries to set these up already if NIX_PROFILES is defined, which won't 44 | # be the case when sourcing $__fish_data_dir/share/config.fish normally, but might be for a 45 | # recursive invocation. To guard against that, we'll only insert paths that don't already exit. 46 | # Furthermore, for the vendor_conf.d sourcing, we'll use the pre-existing presence of a path in 47 | # $fish_function_path to determine whether we want to source the relevant vendor_conf.d folder. 48 | 49 | # To start, let's locally define NIX_PROFILES if it doesn't already exist. 50 | set -al NIX_PROFILES 51 | if test (count $NIX_PROFILES) -eq 0 52 | set -a NIX_PROFILES $HOME/.nix-profile 53 | end 54 | # Replicate the logic from nixpkgs version of $__fish_data_dir/__fish_build_paths.fish. 55 | set -l __nix_profile_paths (string split ' ' -- $NIX_PROFILES)[-1..1] 56 | set -l __extra_completionsdir \ 57 | $__nix_profile_paths/etc/fish/completions \ 58 | $__nix_profile_paths/share/fish/vendor_completions.d 59 | set -l __extra_functionsdir \ 60 | $__nix_profile_paths/etc/fish/functions \ 61 | $__nix_profile_paths/share/fish/vendor_functions.d 62 | set -l __extra_confdir \ 63 | $__nix_profile_paths/etc/fish/conf.d \ 64 | $__nix_profile_paths/share/fish/vendor_conf.d \ 65 | 66 | ### Configure fish_function_path ### 67 | # Remove any of our extra paths that may already exist. 68 | # Record the equivalent __extra_confdir path for any function path that exists. 69 | set -l existing_conf_paths 70 | for path in $__extra_functionsdir 71 | if set -l idx (contains --index -- $path $fish_function_path) 72 | set -e fish_function_path[$idx] 73 | set -a existing_conf_paths $__extra_confdir[(contains --index -- $path $__extra_functionsdir)] 74 | end 75 | end 76 | # Insert the paths before $__fish_data_dir. 77 | if set -l idx (contains --index -- $__fish_data_dir/functions $fish_function_path) 78 | # Fish has no way to simply insert into the middle of an array. 79 | set -l new_path $fish_function_path[1..$idx] 80 | set -e new_path[$idx] 81 | set -a new_path $__extra_functionsdir 82 | set fish_function_path $new_path $fish_function_path[$idx..-1] 83 | else 84 | set -a fish_function_path $__extra_functionsdir 85 | end 86 | 87 | ### Configure fish_complete_path ### 88 | # Remove any of our extra paths that may already exist. 89 | for path in $__extra_completionsdir 90 | if set -l idx (contains --index -- $path $fish_complete_path) 91 | set -e fish_complete_path[$idx] 92 | end 93 | end 94 | # Insert the paths before $__fish_data_dir. 95 | if set -l idx (contains --index -- $__fish_data_dir/completions $fish_complete_path) 96 | set -l new_path $fish_complete_path[1..$idx] 97 | set -e new_path[$idx] 98 | set -a new_path $__extra_completionsdir 99 | set fish_complete_path $new_path $fish_complete_path[$idx..-1] 100 | else 101 | set -a fish_complete_path $__extra_completionsdir 102 | end 103 | 104 | ### Source conf directories ### 105 | # The built-in directories were already sourced during shell initialization. 106 | # Any __extra_confdir that came from $__fish_data_dir/__fish_build_paths.fish was also sourced. 107 | # As explained above, we're using the presence of pre-existing paths in $fish_function_path as a 108 | # signal that the corresponding conf dir has also already been sourced. 109 | # In order to simulate this, we'll run through the same algorithm as found in 110 | # $__fish_data_dir/config.fish except we'll avoid sourcing the file if it comes from an 111 | # already-sourced location. 112 | # Caveats: 113 | # * Files will be sourced in a different order than we'd ideally do (because we're coming in 114 | # after the fact to source them). 115 | # * If there are existing extra conf paths, files in them may have been sourced that should have 116 | # been suppressed by paths we're inserting in front. 117 | # * Similarly any files in $__fish_data_dir/vendor_conf.d that should have been suppressed won't 118 | # have been. 119 | set -l sourcelist 120 | for file in $__fish_config_dir/conf.d/*.fish $__fish_sysconf_dir/conf.d/*.fish 121 | # We know these paths were sourced already. Just record them. 122 | set -l basename (string replace -r '^.*/' '' -- $file) 123 | contains -- $basename $sourcelist 124 | or set -a sourcelist $basename 125 | end 126 | for root in $__extra_confdir 127 | for file in $root/*.fish 128 | set -l basename (string replace -r '^.*/' '' -- $file) 129 | contains -- $basename $sourcelist 130 | and continue 131 | set -a sourcelist $basename 132 | contains -- $root $existing_conf_paths 133 | and continue # this is a pre-existing path, it will have been sourced already 134 | [ -f $file -a -r $file ] 135 | and source $file 136 | end 137 | end 138 | end 139 | --------------------------------------------------------------------------------