From f0b6226866fc3c7e3b063aeaf214dc5e44d288f3 Mon Sep 17 00:00:00 2001 From: Simon Hudson Date: Tue, 17 Feb 2026 10:40:52 +1100 Subject: [PATCH] Add updated config files. --- .config/nvim/init.lua | 79 +++++++++++++++++++++++++++++++++++++++++++ .tmux.conf | 7 ++-- 2 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 .config/nvim/init.lua diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 index 0000000..22b9b18 --- /dev/null +++ b/.config/nvim/init.lua @@ -0,0 +1,79 @@ +-- Bootstrap lazy.nvim +local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim' +if not vim.uv.fs_stat(lazypath) then + vim.fn.system({ 'git', 'clone', '--filter=blob:none', + 'https://github.com/folke/lazy.nvim.git', '--branch=stable', lazypath }) +end +vim.opt.rtp:prepend(lazypath) + +vim.opt.relativenumber = true +vim.opt.clipboard = "unnamedplus" +vim.g.mapleader = " " + +require('lazy').setup({ + { 'rebelot/kanagawa.nvim' }, + { 'nvim-telescope/telescope.nvim', dependencies = { 'nvim-lua/plenary.nvim' } }, + { 'hrsh7th/nvim-cmp', dependencies = { + 'hrsh7th/cmp-nvim-lsp', + 'hrsh7th/cmp-buffer', + 'hrsh7th/cmp-path', + } }, + { 'nvim-treesitter/nvim-treesitter', + build = ':TSUpdate', + opts = { + ensure_installed = { 'c', 'cpp', 'go', 'javascript', 'nix', 'python', 'ruby', 'sql', 'terraform', 'typescript', 'zig' }, + }, + }, + { 'tpope/vim-fugitive' }, + { 'neovim/nvim-lspconfig' }, + { 'preservim/nerdtree' }, +}) + +vim.cmd('colorscheme kanagawa') + +local builtin = require('telescope.builtin') +vim.keymap.set('n', 'f', builtin.git_files, {}) +vim.keymap.set('n', 'pf', builtin.find_files, {}) +vim.keymap.set('n', 's', function() builtin.lsp_document_symbols { symbol_width = 50 } end, {}) +vim.keymap.set('n', 'c', builtin.commands, {}) +vim.keymap.set('n', 't', builtin.treesitter, {}) +vim.keymap.set('n', 'd', function() builtin.diagnostics({ bufnr = 0 }) end, {}) +vim.keymap.set('n', 'D', vim.diagnostic.open_float, {}) +vim.keymap.set('n', 'gd', builtin.lsp_definitions, {}) +vim.keymap.set('n', 'gr', builtin.lsp_references, {}) +vim.keymap.set('n', 'gi', builtin.lsp_implementations, {}) +vim.keymap.set('n', 'b', builtin.buffers, {}) +vim.keymap.set('n', '', builtin.grep_string, {}) +vim.keymap.set('n', 'L', builtin.live_grep, {}) +vim.keymap.set('n', 'z=', builtin.spell_suggest, {}) +vim.keymap.set("n", "ca", vim.lsp.buf.code_action, {}) +vim.keymap.set("n", "rn", vim.lsp.buf.rename, {}) +vim.keymap.set("i", "", vim.lsp.buf.signature_help, {}) + +vim.diagnostic.config({ virtual_text = { current_line = true } }) +vim.api.nvim_create_autocmd("BufWritePre", { callback = function() vim.lsp.buf.format() end }) + +local cmp = require('cmp') +cmp.setup({ + sources = { { name = 'nvim_lsp', keyword_length = 2 }, { name = 'path' }, { name = 'buffer', keyword_length = 2 } }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.confirm({ select = true }), + [''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.select_next_item(), + }), + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered() + }, +}) + +vim.lsp.config('gopls', { cmd_env = { GOOS = "js", GOARCH = "wasm" } }) +vim.lsp.config('golangci_lint_ls', { cmd_env = { GOOS = "js", GOARCH = "wasm" } }) +vim.lsp.config('nil_ls', { settings = { ['nil'] = { formatting = { command = { "nixfmt" } } } } }) + +local lsps = { "pyrefly", "golangci_lint_ls", "gopls", "lua_ls", "nil_ls", "pyright", "rubocop", "ts_ls", "zls", + 'superhtml' } +for _, name in ipairs(lsps) do + vim.lsp.enable(name) +end + diff --git a/.tmux.conf b/.tmux.conf index 8db6822..3c85265 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -1,3 +1,7 @@ +set -g default-terminal "screen-256color" +set -g base-index 1 +setw -g pane-base-index 1 + set-option -g history-limit 10000 # Set prefix to Ctrl-Space instead of Ctrl-b @@ -9,9 +13,6 @@ setw -g mode-keys vi set-option -sg escape-time 10 set -g @plugin 'tmux-plugins/tpm' -set -g @plugin 'tmux-plugins/tmux-sensible' set -g @plugin 'tmux-plugins/tmux-resurrect' -set -g @resurrect-strategy-nvim 'session' -# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) run '~/.tmux/plugins/tpm/tpm'