diff --git a/home/.chezmoiscripts/run_onchange_add-non-steam.sh b/home/.chezmoiscripts/run_onchange_add-non-steam.sh index 9ee1fbfc..efff7a39 100644 --- a/home/.chezmoiscripts/run_onchange_add-non-steam.sh +++ b/home/.chezmoiscripts/run_onchange_add-non-steam.sh @@ -6,8 +6,11 @@ apps=( "yuzu Yuzu" ) -for app in "${apps[@]}" -do - set -- $app - steamtinkerlaunch addnonsteamgame -ep="$1" -an="$2" -done +if command -v steamtinkerlaunch &> /dev/null +then + for app in "${apps[@]}" + do + set -- $app + steamtinkerlaunch addnonsteamgame -ep="$1" -an="$2" + done +fi diff --git a/home/devel/work/dot_gitconfig.work b/home/devel/work/dot_gitconfig.work deleted file mode 100644 index 9c18bb6e..00000000 --- a/home/devel/work/dot_gitconfig.work +++ /dev/null @@ -1,19 +0,0 @@ -##⠀⠀⠀⠀⠀⠀⠀⠀⢠⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀ -#⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀ -#⠀⠀⠀⠀⠀⠀⠀⠀⣼⡏⠸⣧⠀⠀⠀⠀⠀⠀⠀⠀ -#⠠⢤⣤⣤⣤⣤⣤⣴⡿⠀⠀⢻⣦⣤⣤⣤⣤⣤⡤⠄ Tyler Starr (starr-dusT) -#⠀⠀⠙⠻⣦⣄⠀⠀⠀⠀⠀⠀⠀⠀⣠⣴⠟⠋⠀⠀ https://github.com/starr-dusT/dotfiles -#⠀⠀⠀⠀⠀⠙⣿⡆⠀⠀⠀⠀⠰⣿⠋⠀⠀⠀⠀⠀ https://tstarr.us -#⠀⠀⠀⠀⠀⢰⡟⠀⣀⣴⣦⣀⠀⢻⡆⠀⠀⠀⠀⠀ -#⠀⠀⠀⠀⢀⣾⣧⡾⠛⠁⠈⠙⠷⣼⣿⡀⠀⠀⠀⠀ -# ⠀⠀⠀⡸⠟⠁⠀⠀⠀⠀⠀⠀⠈⠛⢧⠀⠀⠀⠀ -# -# Work .gitconfig - -[user] -email = tyler.starr.1@us.af.mil -name = Tyler Starr -signingkey = C0D188999C0697C0 - -[gitlab] -user = "tstarr" diff --git a/home/dot_aliases b/home/dot_aliases index 69ee93ab..ead6466c 100644 --- a/home/dot_aliases +++ b/home/dot_aliases @@ -2,7 +2,7 @@ # https://github.com/starr-dusT/dotfiles # nixos -alias nixos-update="cd ~/.local/share/chezmoi/provision/nixos && \ +alias nu="cd ~/.local/share/chezmoi/provision/nixos && \ sudo nixos-rebuild switch --flake .#$(hostname) && \ cd -" # sway diff --git a/home/dot_config/nvim/after/plugin/lsp.lua b/home/dot_config/nvim/after/plugin/lsp.lua index a0f6bd59..da4e71e9 100644 --- a/home/dot_config/nvim/after/plugin/lsp.lua +++ b/home/dot_config/nvim/after/plugin/lsp.lua @@ -1,153 +1,60 @@ -local Remap = require("tstarr.keymap") -local nnoremap = Remap.nnoremap -local inoremap = Remap.inoremap +local lsp = require("lsp-zero") + +lsp.preset("recommended") + +lsp.ensure_installed({ + 'tsserver', + 'pyright', + 'lua_ls', +}) + +-- Fix Undefined global 'vim' +lsp.nvim_workspace() + + local cmp = require('cmp') -local lspconfig = require('lspconfig') -local configs = require('lspconfig/configs') - -cmp.setup({ - snippet = { - expand = function(args) - require('luasnip').lsp_expand(args.body) -- For `luasnip` users. - end, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - else - fallback() - end - end, { "i" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - else - fallback() - end - end, { "i" }), - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - }), - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'luasnip' }, -- For luasnip users. - }, { - { name = 'buffer', - option = { - get_bufnrs = function() - local bufs = {} - for _, win in ipairs(vim.api.nvim_list_wins()) do - bufs[vim.api.nvim_win_get_buf(win)] = true - end - return vim.tbl_keys(bufs) - end - } - }, - }) +local cmp_select = {behavior = cmp.SelectBehavior.Select} +local cmp_mappings = lsp.defaults.cmp_mappings({ + [''] = cmp.mapping.select_prev_item(cmp_select), + [''] = cmp.mapping.select_next_item(cmp_select), + [''] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping.complete(), }) -cmp.setup.cmdline('/', { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = 'buffer' } - } +cmp_mappings[''] = nil +cmp_mappings[''] = nil + +lsp.setup_nvim_cmp({ + mapping = cmp_mappings }) -cmp.setup.cmdline(':', { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = 'path' }, - { name = 'buffer' } - }, { - { - name = 'cmdline', - option = { - ignore_cmds = { 'Man', '!' } - } +lsp.set_preferences({ + suggest_lsp_servers = false, + sign_icons = { + error = 'E', + warn = 'W', + hint = 'H', + info = 'I' } - }) }) -local function config(_config) - return vim.tbl_deep_extend("force", { - on_attach = function() - local opts = { buffer = true }; - nnoremap("gd", function() vim.lsp.buf.definition() end, opts) - nnoremap("K", function() vim.lsp.buf.hover() end, opts) - nnoremap("vws", function() vim.lsp.buf.workspace_symbol() end, opts) - nnoremap("vd", function() vim.diagnostic.open_float() end, opts) - nnoremap("[d", function() vim.diagnostic.goto_next() end, opts) - nnoremap("]d", function() vim.diagnostic.goto_prev() end, opts) - nnoremap("vca", function() vim.lsp.buf.code_action() end, opts) - nnoremap("vco", function() vim.lsp.buf.code_action({ - filter = function(code_action) - if not code_action or not code_action.data then - return false - end - - local data = code_action.data.id - return string.sub(data, #data - 1, #data) == ":0" - end, - apply = true - }) end, opts) - nnoremap("vrr", function() vim.lsp.buf.references() end, opts) - nnoremap("vrn", function() vim.lsp.buf.rename() end, opts) - inoremap("", function() vim.lsp.buf.signature_help() end, opts) - end, - }, _config or {}) -end - --- Python -lspconfig.tsserver.setup(config()) -lspconfig.pyright.setup(config()) - --- zk -configs.zk = { - default_config = { - cmd = {'zk', 'lsp'}, - filetypes = {'markdown'}, - root_dir = function() - return vim.loop.cwd() - end, - settings = {} - }; -} - -lspconfig.zk.setup({ on_attach = function(client, buffer) - -- Add keybindings here, see https://github.com/neovim/nvim-lspconfig#keybindings-and-completion -end }) - - - - - - - - - - - - - - - - - - - - - - - - +lsp.on_attach(function(client, bufnr) + local opts = {buffer = bufnr, remap = false} + vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) + vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) + vim.keymap.set("n", "vws", function() vim.lsp.buf.workspace_symbol() end, opts) + vim.keymap.set("n", "vd", function() vim.diagnostic.open_float() end, opts) + vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts) + vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts) + vim.keymap.set("n", "vca", function() vim.lsp.buf.code_action() end, opts) + vim.keymap.set("n", "vrr", function() vim.lsp.buf.references() end, opts) + vim.keymap.set("n", "vrn", function() vim.lsp.buf.rename() end, opts) + vim.keymap.set("i", "", function() vim.lsp.buf.signature_help() end, opts) +end) +lsp.setup() +vim.diagnostic.config({ + virtual_text = true +}) diff --git a/home/dot_config/nvim/lua/tstarr/packer.lua b/home/dot_config/nvim/lua/tstarr/packer.lua index d7cf1b8d..b3398a3e 100644 --- a/home/dot_config/nvim/lua/tstarr/packer.lua +++ b/home/dot_config/nvim/lua/tstarr/packer.lua @@ -13,11 +13,8 @@ return require('packer').startup(function(use) use ('alker0/chezmoi.vim') use ('nathangrigg/vim-beancount') - -- IDE + -- IDE use('nvim-lua/plenary.nvim') - use("nvim-treesitter/nvim-treesitter", { - run = ":TSUpdate" - }) use ('nvim-telescope/telescope.nvim') use ('nvim-telescope/telescope-project.nvim') @@ -32,13 +29,28 @@ return require('packer').startup(function(use) use('mcchrish/nnn.vim') -- LSP - use ('neovim/nvim-lspconfig') - use ('hrsh7th/cmp-nvim-lsp') - use ('hrsh7th/cmp-buffer') - use ('hrsh7th/cmp-path') - use ('hrsh7th/cmp-cmdline') - use ('hrsh7th/nvim-cmp') - use ('L3MON4D3/LuaSnip') - use ('saadparwaiz1/cmp_luasnip') + use("nvim-treesitter/nvim-treesitter-context"); + use { + 'VonHeikemen/lsp-zero.nvim', + branch = 'v1.x', + requires = { + -- LSP Support + {'neovim/nvim-lspconfig'}, + {'williamboman/mason.nvim'}, + {'williamboman/mason-lspconfig.nvim'}, + + -- Autocompletion + {'hrsh7th/nvim-cmp'}, + {'hrsh7th/cmp-buffer'}, + {'hrsh7th/cmp-path'}, + {'saadparwaiz1/cmp_luasnip'}, + {'hrsh7th/cmp-nvim-lsp'}, + {'hrsh7th/cmp-nvim-lua'}, + + -- Snippets + {'L3MON4D3/LuaSnip'}, + {'rafamadriz/friendly-snippets'}, + } + } end) diff --git a/home/dot_config/sway/config.tmpl b/home/dot_config/sway/config.tmpl index 288f7930..de1db5af 100644 --- a/home/dot_config/sway/config.tmpl +++ b/home/dot_config/sway/config.tmpl @@ -194,7 +194,7 @@ mode launcher { } bindsym $mod+o mode open mode open { - bindsym b exec brave, $e + bindsym b exec chromium, $e bindsym s exec steam || flatpak run com.valvesoftware.Steam, $e bindsym d exec discord || flatpak run com.discordapp.Discord, $e bindsym Escape mode default diff --git a/home/dot_export b/home/dot_exports similarity index 100% rename from home/dot_export rename to home/dot_exports diff --git a/home/dot_gitconfig b/home/dot_gitconfig index 9e9cc5eb..6f9e1c32 100644 --- a/home/dot_gitconfig +++ b/home/dot_gitconfig @@ -1,13 +1,4 @@ -##⠀⠀⠀⠀⠀⠀⠀⠀⢠⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀ -#⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀ -#⠀⠀⠀⠀⠀⠀⠀⠀⣼⡏⠸⣧⠀⠀⠀⠀⠀⠀⠀⠀ -#⠠⢤⣤⣤⣤⣤⣤⣴⡿⠀⠀⢻⣦⣤⣤⣤⣤⣤⡤⠄ Tyler Starr (starr-dusT) -#⠀⠀⠙⠻⣦⣄⠀⠀⠀⠀⠀⠀⠀⠀⣠⣴⠟⠋⠀⠀ https://github.com/starr-dusT/dotfiles -#⠀⠀⠀⠀⠀⠙⣿⡆⠀⠀⠀⠀⠰⣿⠋⠀⠀⠀⠀⠀ https://tstarr.us -#⠀⠀⠀⠀⠀⢰⡟⠀⣀⣴⣦⣀⠀⢻⡆⠀⠀⠀⠀⠀ -#⠀⠀⠀⠀⢀⣾⣧⡾⠛⠁⠈⠙⠷⣼⣿⡀⠀⠀⠀⠀ -# ⠀⠀⠀⡸⠟⠁⠀⠀⠀⠀⠀⠀⠈⠛⢧⠀⠀⠀⠀ -# +# https://github.com/starr-dusT/dotfiles # Global .gitconfig [user] @@ -19,6 +10,3 @@ [core] sshCommand = "ssh -i ~/.ssh/keys/github_personal" - -[includeIf "gitdir:~/devel/work/**"] - path = ~/devel/work/.gitconfig.work diff --git a/home/dot_tmux.conf b/home/dot_tmux.conf index a6f86b94..e629209f 100644 --- a/home/dot_tmux.conf +++ b/home/dot_tmux.conf @@ -1,13 +1,4 @@ -##⠀⠀⠀⠀⠀⠀⠀⠀⢠⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀ -#⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀ -#⠀⠀⠀⠀⠀⠀⠀⠀⣼⡏⠸⣧⠀⠀⠀⠀⠀⠀⠀⠀ -#⠠⢤⣤⣤⣤⣤⣤⣴⡿⠀⠀⢻⣦⣤⣤⣤⣤⣤⡤⠄ Tyler Starr (starr-dusT) -#⠀⠀⠙⠻⣦⣄⠀⠀⠀⠀⠀⠀⠀⠀⣠⣴⠟⠋⠀⠀ https://github.com/starr-dusT/dotfiles -#⠀⠀⠀⠀⠀⠙⣿⡆⠀⠀⠀⠀⠰⣿⠋⠀⠀⠀⠀⠀ https://tstarr.us -#⠀⠀⠀⠀⠀⢰⡟⠀⣀⣴⣦⣀⠀⢻⡆⠀⠀⠀⠀⠀ -#⠀⠀⠀⠀⢀⣾⣧⡾⠛⠁⠈⠙⠷⣼⣿⡀⠀⠀⠀⠀ -# ⠀⠀⠀⡸⠟⠁⠀⠀⠀⠀⠀⠀⠈⠛⢧⠀⠀⠀⠀ -# +# https://github.com/starr-dusT/dotfiles # vim style tmux config # use C-a, since it's on the home row and easier to hit than C-b