From 2bae0eda2df481e90e9a56ac9d59a18d027b5f35 Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Mon, 2 Jan 2023 23:47:32 +1100 Subject: [PATCH 01/27] neovim lua config --- coc-nvim/package.json | 9 ++-- init.vim => init.vimold | 0 nvim/after/plugin/colors.lua | 2 + nvim/after/plugin/fugitive.lua | 1 + nvim/after/plugin/harpoon.lua | 10 +++++ nvim/after/plugin/lsp.lua | 76 ++++++++++++++++++++++++++++++++ nvim/after/plugin/telescope.lua | 10 +++++ nvim/after/plugin/treesitter.lua | 22 +++++++++ nvim/after/plugin/undotree.lua | 2 + nvim/init.lua | 3 ++ nvim/lua/llago/init.lua | 3 ++ nvim/lua/llago/packer.lua | 61 +++++++++++++++++++++++++ nvim/lua/llago/remap.lua | 33 ++++++++++++++ nvim/lua/llago/set.lua | 30 +++++++++++++ nvim/oi | 33 ++++++++++++++ 15 files changed, 291 insertions(+), 4 deletions(-) rename init.vim => init.vimold (100%) create mode 100644 nvim/after/plugin/colors.lua create mode 100644 nvim/after/plugin/fugitive.lua create mode 100644 nvim/after/plugin/harpoon.lua create mode 100644 nvim/after/plugin/lsp.lua create mode 100644 nvim/after/plugin/telescope.lua create mode 100644 nvim/after/plugin/treesitter.lua create mode 100644 nvim/after/plugin/undotree.lua create mode 100644 nvim/init.lua create mode 100644 nvim/lua/llago/init.lua create mode 100644 nvim/lua/llago/packer.lua create mode 100644 nvim/lua/llago/remap.lua create mode 100644 nvim/lua/llago/set.lua create mode 100755 nvim/oi diff --git a/coc-nvim/package.json b/coc-nvim/package.json index ba5fa90..d2d0e99 100644 --- a/coc-nvim/package.json +++ b/coc-nvim/package.json @@ -8,8 +8,9 @@ "coc-explorer": "*", "coc-html": "*", "coc-json": "*", - "coc-prettier": "*", "coc-tsserver": "*", - "coc-yaml": "*" - } -} + "coc-yaml": "*", + "coc-prettier": ">=9.3.1" + }, + "lastUpdate": 1672644168821 +} \ No newline at end of file diff --git a/init.vim b/init.vimold similarity index 100% rename from init.vim rename to init.vimold diff --git a/nvim/after/plugin/colors.lua b/nvim/after/plugin/colors.lua new file mode 100644 index 0000000..615ec2e --- /dev/null +++ b/nvim/after/plugin/colors.lua @@ -0,0 +1,2 @@ +vim.o.background = "dark" -- or "light" for light mode +vim.cmd([[colorscheme gruvbox]]) diff --git a/nvim/after/plugin/fugitive.lua b/nvim/after/plugin/fugitive.lua new file mode 100644 index 0000000..6e1b92d --- /dev/null +++ b/nvim/after/plugin/fugitive.lua @@ -0,0 +1 @@ +vim.keymap.set('n', 'gs', vim.cmd.Git) diff --git a/nvim/after/plugin/harpoon.lua b/nvim/after/plugin/harpoon.lua new file mode 100644 index 0000000..9bfa3ef --- /dev/null +++ b/nvim/after/plugin/harpoon.lua @@ -0,0 +1,10 @@ +local mark = require('harpoon.mark') +local ui = require('harpoon.ui') + +vim.keymap.set('n', 'a', mark.add_file) +vim.keymap.set('n', '', ui.toggle_quick_menu) + +vim.keymap.set('n', '', function () ui.nav_file(1) end) +vim.keymap.set('n', '', function () ui.nav_file(2) end) +vim.keymap.set('n', '', function () ui.nav_file(3) end) +vim.keymap.set('n', '', function () ui.nav_file(4) end) diff --git a/nvim/after/plugin/lsp.lua b/nvim/after/plugin/lsp.lua new file mode 100644 index 0000000..084a3aa --- /dev/null +++ b/nvim/after/plugin/lsp.lua @@ -0,0 +1,76 @@ +local lsp = require("lsp-zero") + +lsp.preset("recommended") + +lsp.ensure_installed({ + 'tsserver', + 'eslint', + 'sumneko_lua', + 'rust_analyzer', +}) + +-- Fix Undefined global 'vim' +lsp.configure('sumneko_lua', { + settings = { + Lua = { + diagnostics = { + globals = { 'vim' } + } + } + } +}) + + +local cmp = require('cmp') +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(), +}) + +-- disable completion with tab +-- this helps with copilot setup +cmp_mappings[''] = nil +cmp_mappings[''] = nil + +lsp.setup_nvim_cmp({ + mapping = cmp_mappings +}) + +lsp.set_preferences({ + suggest_lsp_servers = false, + sign_icons = { + error = 'E', + warn = 'W', + hint = 'H', + info = 'I' + } +}) + +lsp.on_attach(function(client, bufnr) + local opts = {buffer = bufnr, remap = false} + + if client.name == "eslint" then + vim.cmd.LspStop('eslint') + return + end + + vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) + vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) + vim.keymap.set("n", "vws", vim.lsp.buf.workspace_symbol, opts) + vim.keymap.set("n", "vd", vim.diagnostic.open_float, opts) + vim.keymap.set("n", "[d", vim.diagnostic.goto_next, opts) + vim.keymap.set("n", "]d", vim.diagnostic.goto_prev, opts) + vim.keymap.set("n", "vca", vim.lsp.buf.code_action, opts) + vim.keymap.set("n", "vrr", vim.lsp.buf.references, opts) + vim.keymap.set("n", "vrn", vim.lsp.buf.rename, opts) + vim.keymap.set("i", "", vim.lsp.buf.signature_help, opts) +end) + +lsp.setup() + +vim.diagnostic.config({ + virtual_text = true, +}) diff --git a/nvim/after/plugin/telescope.lua b/nvim/after/plugin/telescope.lua new file mode 100644 index 0000000..995a0a5 --- /dev/null +++ b/nvim/after/plugin/telescope.lua @@ -0,0 +1,10 @@ +local builtin = require('telescope.builtin') +vim.keymap.set('n', 'pf', builtin.find_files, {}) +vim.keymap.set('n', '', builtin.git_files, {}) +vim.keymap.set('n', 'ps', function() + builtin.grep_string({ search = vim.fn.input("Grep > ") }); +end) + +vim.keymap.set('n', 'ag', builtin.live_grep, {}) + +vim.keymap.set('n', 'b', builtin.buffers, {}) diff --git a/nvim/after/plugin/treesitter.lua b/nvim/after/plugin/treesitter.lua new file mode 100644 index 0000000..3079a90 --- /dev/null +++ b/nvim/after/plugin/treesitter.lua @@ -0,0 +1,22 @@ +require'nvim-treesitter.configs'.setup { + -- A list of parser names, or "all" + ensure_installed = { "help", "c", "lua", "rust", "javascript", "typescript", "go", "vim"}, + + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, + + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally + auto_install = true, + + highlight = { + -- `false` will disable the whole extension + enable = true, + + -- Setting this to true will run `:h syntax` and tree-sitter at the same time. + -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = false, + }, +} diff --git a/nvim/after/plugin/undotree.lua b/nvim/after/plugin/undotree.lua new file mode 100644 index 0000000..97bb7ab --- /dev/null +++ b/nvim/after/plugin/undotree.lua @@ -0,0 +1,2 @@ +vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) + diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100644 index 0000000..996030d --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1,3 @@ +require("./llago") + +print("hello from init.lua") diff --git a/nvim/lua/llago/init.lua b/nvim/lua/llago/init.lua new file mode 100644 index 0000000..e7516bf --- /dev/null +++ b/nvim/lua/llago/init.lua @@ -0,0 +1,3 @@ +require("llago.remap") +require("llago.packer") +require("llago.set") diff --git a/nvim/lua/llago/packer.lua b/nvim/lua/llago/packer.lua new file mode 100644 index 0000000..12b005c --- /dev/null +++ b/nvim/lua/llago/packer.lua @@ -0,0 +1,61 @@ +local ensure_packer = function() + local fn = vim.fn + local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' + if fn.empty(fn.glob(install_path)) > 0 then + fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) + vim.cmd [[packadd packer.nvim]] + return true + end + return false +end + +local packer_bootstrap = ensure_packer() + +return require('packer').startup(function(use) + use 'wbthomason/packer.nvim' + use { + 'nvim-telescope/telescope.nvim', tag = '0.1.0', + -- or , branch = '0.1.x', + requires = { {'nvim-lua/plenary.nvim'} } + } + + use { "ellisonleao/gruvbox.nvim" } + + use('nvim-treesitter/nvim-treesitter', {run = ':TSUpdate'}) + use('nvim-treesitter/playground') + use('ThePrimeagen/harpoon') + use('mbbill/undotree') + use('tpope/vim-fugitive') + use { + 'VonHeikemen/lsp-zero.nvim', + 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'}, + } +} + + + -- My plugins here + -- use 'foo1/bar1.nvim' + -- use 'foo2/bar2.nvim' + + -- Automatically set up your configuration after cloning packer.nvim + -- Put this at the end after all plugins + if packer_bootstrap then + require('packer').sync() + end +end) diff --git a/nvim/lua/llago/remap.lua b/nvim/lua/llago/remap.lua new file mode 100644 index 0000000..ab21e03 --- /dev/null +++ b/nvim/lua/llago/remap.lua @@ -0,0 +1,33 @@ +vim.g.mapleader = "," + +vim.keymap.set("n", "pv", vim.cmd.Ex) + +vim.keymap.set("v", "J", ":m '>+1gv=gv") +vim.keymap.set("v", "K", ":m '<-2gv=gv") + +vim.keymap.set("n", "J", "mzJ`z") +vim.keymap.set("n", "", "zz") +vim.keymap.set("n", "", "zz") +vim.keymap.set("n", "n", "nzzzv") +vim.keymap.set("n", "N", "Nzzzv") + +-- greatest remap ever +vim.keymap.set("x", "p", [["_dP]]) + +-- next greatest remap ever : asbjornHaland +vim.keymap.set({ "n", "v" }, "y", [["+y]]) +vim.keymap.set("n", "Y", [["+Y]]) + +vim.keymap.set({ "n", "v" }, "d", [["_d]]) + +vim.keymap.set("n", "Q", "") +vim.keymap.set("n", "", "silent !tmux neww tmux-sessionizer") +vim.keymap.set("n", "f", vim.lsp.buf.format) + +vim.keymap.set("n", "", "cnextzz") +vim.keymap.set("n", "", "cprevzz") +vim.keymap.set("n", "k", "lnextzz") +vim.keymap.set("n", "j", "lprevzz") + +vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) +vim.keymap.set("n", "x", "!chmod +x %", { silent = true }) diff --git a/nvim/lua/llago/set.lua b/nvim/lua/llago/set.lua new file mode 100644 index 0000000..83fb9f5 --- /dev/null +++ b/nvim/lua/llago/set.lua @@ -0,0 +1,30 @@ +vim.opt.nu = true +--vim.opt.relativenumber = true + +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.expandtab = true + +vim.opt.smartindent = true + +vim.opt.wrap = false + +vim.opt.swapfile = false +vim.opt.backup = false +vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" +vim.opt.undofile = true + +vim.opt.hlsearch = true +vim.opt.incsearch = true + +vim.opt.termguicolors = true + +vim.opt.scrolloff = 8 +vim.opt.signcolumn = "yes" +vim.opt.isfname:append("@-@") + +vim.opt.updatetime = 50 + +vim.opt.colorcolumn = "80" + diff --git a/nvim/oi b/nvim/oi new file mode 100755 index 0000000..47da7d3 --- /dev/null +++ b/nvim/oi @@ -0,0 +1,33 @@ + +vim.keymap.set({"n", "v"}, "y", [["+y]]) +vim.keymap.set("n", "Y", [["+Y]]) +vim.keymap.set({"n", "v"}, "d", [["_d]]) + +-- This is going to get me cancelled +vim.keymap.set("i", "", "") + +vim.keymap.set("n", "Q", "") +vim.keymap.set("n", "", "silent !tmux neww tmux-sessionizer") +vim.keymap.set("n", "f", vim.lsp.buf.format) + +vim.keymap.set("n", "", "cnextzz") +vim.keymap.set("n", "", "cprevzz") +vim.keymap.set("n", "k", "lnextzz") +-- This is going to get me cancelled +-- This is going to get me cancelled +-- This is going to get me cancelled +-- This is going to get me cancelled +-- This is going to get me cancelled +-- This is going to get me cancelled +-- This is going to get me cancelled +-- This is going to get me cancelled +-- This is going to get me cancelled +-- This is going to get me cancelled +-- This is going to get me cancelled +-- This is going to get me cancelled +-- This is going to get me cancelled +-- This is going to get me cancelled +-- This is going to get me cancelled +-- This is going to get me cancelled +-- This is going to get me cancelled +-- This is going to get me cancelled From 7eac8deebfeedde9ff535325cf43068bb9c9c147 Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Tue, 3 Jan 2023 08:23:14 +1100 Subject: [PATCH 02/27] Add nvim tree to lua config --- nvim/after/plugin/nvimtree.lua | 9 +++ nvim/init.lua | 2 - nvim/lua/llago/packer.lua | 116 ++++++++++++++++++--------------- nvim/lua/llago/set.lua | 2 +- 4 files changed, 72 insertions(+), 57 deletions(-) create mode 100644 nvim/after/plugin/nvimtree.lua diff --git a/nvim/after/plugin/nvimtree.lua b/nvim/after/plugin/nvimtree.lua new file mode 100644 index 0000000..58e685a --- /dev/null +++ b/nvim/after/plugin/nvimtree.lua @@ -0,0 +1,9 @@ +-- disable netrw at the very start of your init.lua (strongly advised) +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 + +vim.keymap.set("n", "", vim.cmd.NvimTreeToggle) +vim.keymap.set("n", "r", vim.cmd.NvimTreeRefresh) +vim.keymap.set("n", "n", vim.cmd.NvimTreeFindFile) + +require("nvim-tree").setup() diff --git a/nvim/init.lua b/nvim/init.lua index 996030d..bf928df 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -1,3 +1 @@ require("./llago") - -print("hello from init.lua") diff --git a/nvim/lua/llago/packer.lua b/nvim/lua/llago/packer.lua index 12b005c..eb865a6 100644 --- a/nvim/lua/llago/packer.lua +++ b/nvim/lua/llago/packer.lua @@ -1,61 +1,69 @@ local ensure_packer = function() - local fn = vim.fn - local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' - if fn.empty(fn.glob(install_path)) > 0 then - fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) - vim.cmd [[packadd packer.nvim]] - return true - end - return false + local fn = vim.fn + local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim' + if fn.empty(fn.glob(install_path)) > 0 then + fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path }) + vim.cmd [[packadd packer.nvim]] + return true + end + return false end local packer_bootstrap = ensure_packer() return require('packer').startup(function(use) - use 'wbthomason/packer.nvim' - use { - 'nvim-telescope/telescope.nvim', tag = '0.1.0', - -- or , branch = '0.1.x', - requires = { {'nvim-lua/plenary.nvim'} } - } - - use { "ellisonleao/gruvbox.nvim" } - - use('nvim-treesitter/nvim-treesitter', {run = ':TSUpdate'}) - use('nvim-treesitter/playground') - use('ThePrimeagen/harpoon') - use('mbbill/undotree') - use('tpope/vim-fugitive') - use { - 'VonHeikemen/lsp-zero.nvim', - 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'}, - } -} - - - -- My plugins here - -- use 'foo1/bar1.nvim' - -- use 'foo2/bar2.nvim' - - -- Automatically set up your configuration after cloning packer.nvim - -- Put this at the end after all plugins - if packer_bootstrap then - require('packer').sync() - end + use 'wbthomason/packer.nvim' + use { + 'nvim-telescope/telescope.nvim', tag = '0.1.0', + -- or , branch = '0.1.x', + requires = { { 'nvim-lua/plenary.nvim' } } + } + + use { "ellisonleao/gruvbox.nvim" } + use { + 'nvim-tree/nvim-tree.lua', + requires = { + 'nvim-tree/nvim-web-devicons', -- optional, for file icons + }, + } + use('kyazdani42/nvim-web-devicons') + + use('nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' }) + use('nvim-treesitter/playground') + use('ThePrimeagen/harpoon') + use('mbbill/undotree') + use('tpope/vim-fugitive') + use { + 'VonHeikemen/lsp-zero.nvim', + 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' }, + } + } + -- status line + use { + 'nvim-lualine/lualine.nvim', + requires = { 'kyazdani42/nvim-web-devicons', opt = true } + } + + + -- Automatically set up your configuration after cloning packer.nvim + -- Put this at the end after all plugins + if packer_bootstrap then + require('packer').sync() + end end) diff --git a/nvim/lua/llago/set.lua b/nvim/lua/llago/set.lua index 83fb9f5..5932073 100644 --- a/nvim/lua/llago/set.lua +++ b/nvim/lua/llago/set.lua @@ -27,4 +27,4 @@ vim.opt.isfname:append("@-@") vim.opt.updatetime = 50 vim.opt.colorcolumn = "80" - +vim.opt.clipboard = 'unnamedplus' From 80ae32a4f26e35440dd4d6bf2d0e249d9646033a Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Tue, 3 Jan 2023 08:26:50 +1100 Subject: [PATCH 03/27] Add status line --- nvim/after/plugin/lualine.lua | 1 + nvim/lua/llago/packer.lua | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 nvim/after/plugin/lualine.lua diff --git a/nvim/after/plugin/lualine.lua b/nvim/after/plugin/lualine.lua new file mode 100644 index 0000000..bcb76db --- /dev/null +++ b/nvim/after/plugin/lualine.lua @@ -0,0 +1 @@ +require('lualine').setup({ theme = 'gruvbox' }) diff --git a/nvim/lua/llago/packer.lua b/nvim/lua/llago/packer.lua index eb865a6..01f9a22 100644 --- a/nvim/lua/llago/packer.lua +++ b/nvim/lua/llago/packer.lua @@ -12,27 +12,36 @@ end local packer_bootstrap = ensure_packer() return require('packer').startup(function(use) + -- Plugin manager use 'wbthomason/packer.nvim' + -- Fuzzy finder use { 'nvim-telescope/telescope.nvim', tag = '0.1.0', -- or , branch = '0.1.x', requires = { { 'nvim-lua/plenary.nvim' } } } - + -- Theme use { "ellisonleao/gruvbox.nvim" } + -- File explorer use { 'nvim-tree/nvim-tree.lua', requires = { 'nvim-tree/nvim-web-devicons', -- optional, for file icons }, } + -- Icons use('kyazdani42/nvim-web-devicons') - + -- Highlighting use('nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' }) + -- AST debugger use('nvim-treesitter/playground') + -- File navigation "favorites" use('ThePrimeagen/harpoon') + -- Undo history use('mbbill/undotree') + -- Git support use('tpope/vim-fugitive') + -- LSP use { 'VonHeikemen/lsp-zero.nvim', requires = { @@ -54,7 +63,7 @@ return require('packer').startup(function(use) { 'rafamadriz/friendly-snippets' }, } } - -- status line + -- Status line use { 'nvim-lualine/lualine.nvim', requires = { 'kyazdani42/nvim-web-devicons', opt = true } From 099d76db510aa97b9c82449184e9f6f1eb6c1518 Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Tue, 3 Jan 2023 08:58:40 +1100 Subject: [PATCH 04/27] Move missing stes to lua config --- nvim/lua/llago/remap.lua | 3 +++ nvim/lua/llago/set.lua | 40 +++++++++++++++++++++++++++++++++++----- nvim/oi | 33 --------------------------------- 3 files changed, 38 insertions(+), 38 deletions(-) delete mode 100755 nvim/oi diff --git a/nvim/lua/llago/remap.lua b/nvim/lua/llago/remap.lua index ab21e03..e63636b 100644 --- a/nvim/lua/llago/remap.lua +++ b/nvim/lua/llago/remap.lua @@ -31,3 +31,6 @@ vim.keymap.set("n", "j", "lprevzz") vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) vim.keymap.set("n", "x", "!chmod +x %", { silent = true }) + +vim.keymap.set("n", "+", ':exe "resize" . (winheight(0) * 3/2) ') +vim.keymap.set("n", "-", ':exe "resize" . (winheight(0) * 2/3) ') diff --git a/nvim/lua/llago/set.lua b/nvim/lua/llago/set.lua index 5932073..7f601a9 100644 --- a/nvim/lua/llago/set.lua +++ b/nvim/lua/llago/set.lua @@ -6,8 +6,6 @@ vim.opt.softtabstop = 4 vim.opt.shiftwidth = 4 vim.opt.expandtab = true -vim.opt.smartindent = true - vim.opt.wrap = false vim.opt.swapfile = false @@ -15,8 +13,6 @@ vim.opt.backup = false vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" vim.opt.undofile = true -vim.opt.hlsearch = true -vim.opt.incsearch = true vim.opt.termguicolors = true @@ -26,5 +22,39 @@ vim.opt.isfname:append("@-@") vim.opt.updatetime = 50 -vim.opt.colorcolumn = "80" +vim.opt.colorcolumn = "120" vim.opt.clipboard = 'unnamedplus' +vim.opt.cmdheight = 2 +vim.opt.hidden = true +vim.opt.textwidth = 0 +vim.opt.wrapmargin = 0 +vim.opt.linebreak = true +vim.opt.list = true +vim.opt.lazyredraw = true +vim.opt.ruler = true +-- No bells +vim.opt.visualbell = false +vim.opt.errorbells = false +-- Tab +vim.opt.expandtab = true +vim.opt.tabstop = 2 +vim.opt.softtabstop = 0 +vim.opt.shiftwidth = 2 +vim.opt.smarttab = true +vim.opt.showmatch = true +vim.opt.smartcase = true + +-- Search +vim.opt.ignorecase = true +vim.opt.hlsearch = true +vim.opt.incsearch = true +vim.opt.matchtime = 0 + + +-- Indentation +vim.opt.autoindent = true +vim.opt.smartindent = true + +-- Splits +vim.opt.splitbelow = true +vim.opt.splitright = true diff --git a/nvim/oi b/nvim/oi deleted file mode 100755 index 47da7d3..0000000 --- a/nvim/oi +++ /dev/null @@ -1,33 +0,0 @@ - -vim.keymap.set({"n", "v"}, "y", [["+y]]) -vim.keymap.set("n", "Y", [["+Y]]) -vim.keymap.set({"n", "v"}, "d", [["_d]]) - --- This is going to get me cancelled -vim.keymap.set("i", "", "") - -vim.keymap.set("n", "Q", "") -vim.keymap.set("n", "", "silent !tmux neww tmux-sessionizer") -vim.keymap.set("n", "f", vim.lsp.buf.format) - -vim.keymap.set("n", "", "cnextzz") -vim.keymap.set("n", "", "cprevzz") -vim.keymap.set("n", "k", "lnextzz") --- This is going to get me cancelled --- This is going to get me cancelled --- This is going to get me cancelled --- This is going to get me cancelled --- This is going to get me cancelled --- This is going to get me cancelled --- This is going to get me cancelled --- This is going to get me cancelled --- This is going to get me cancelled --- This is going to get me cancelled --- This is going to get me cancelled --- This is going to get me cancelled --- This is going to get me cancelled --- This is going to get me cancelled --- This is going to get me cancelled --- This is going to get me cancelled --- This is going to get me cancelled --- This is going to get me cancelled From fb403794fae691f959f998d1c36fe8b44a79d7d2 Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Tue, 3 Jan 2023 09:48:34 +1100 Subject: [PATCH 05/27] Configure fzf with telescope --- Brewfile | 1 + nvim/after/plugin/telescope.lua | 16 +++- nvim/lua/llago/packer.lua | 134 ++++++++++++++++---------------- 3 files changed, 85 insertions(+), 66 deletions(-) diff --git a/Brewfile b/Brewfile index 78436e1..069bed1 100644 --- a/Brewfile +++ b/Brewfile @@ -21,6 +21,7 @@ brew "rust" brew "hashicorp/tap/terraform-ls" brew "tmate" brew "bat" +brew "fd" cask "stats" cask "docker" diff --git a/nvim/after/plugin/telescope.lua b/nvim/after/plugin/telescope.lua index 995a0a5..9c8287c 100644 --- a/nvim/after/plugin/telescope.lua +++ b/nvim/after/plugin/telescope.lua @@ -2,9 +2,23 @@ local builtin = require('telescope.builtin') vim.keymap.set('n', 'pf', builtin.find_files, {}) vim.keymap.set('n', '', builtin.git_files, {}) vim.keymap.set('n', 'ps', function() - builtin.grep_string({ search = vim.fn.input("Grep > ") }); + builtin.grep_string({ search = vim.fn.input("Grep > ") }); end) vim.keymap.set('n', 'ag', builtin.live_grep, {}) vim.keymap.set('n', 'b', builtin.buffers, {}) + +require('telescope').setup { + extensions = { + fzf = { + fuzzy = true, -- false will only do exact matching + override_generic_sorter = true, -- override the generic sorter + override_file_sorter = true, -- override the file sorter + case_mode = "smart_case", -- or "ignore_case" or "respect_case" + -- the default case_mode is "smart_case" + } + } +} + +require('telescope').load_extension('fzf') diff --git a/nvim/lua/llago/packer.lua b/nvim/lua/llago/packer.lua index 01f9a22..7f59a66 100644 --- a/nvim/lua/llago/packer.lua +++ b/nvim/lua/llago/packer.lua @@ -1,78 +1,82 @@ local ensure_packer = function() - local fn = vim.fn - local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim' - if fn.empty(fn.glob(install_path)) > 0 then - fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path }) - vim.cmd [[packadd packer.nvim]] - return true - end - return false + local fn = vim.fn + local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim' + if fn.empty(fn.glob(install_path)) > 0 then + fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path }) + vim.cmd [[packadd packer.nvim]] + return true + end + return false end local packer_bootstrap = ensure_packer() return require('packer').startup(function(use) - -- Plugin manager - use 'wbthomason/packer.nvim' - -- Fuzzy finder - use { - 'nvim-telescope/telescope.nvim', tag = '0.1.0', - -- or , branch = '0.1.x', - requires = { { 'nvim-lua/plenary.nvim' } } + -- Plugin manager + use 'wbthomason/packer.nvim' + -- Fuzzy finder + use { + 'nvim-telescope/telescope.nvim', tag = '0.1.0', + requires = { + { 'nvim-lua/plenary.nvim' }, + { 'nvim-telescope/telescope-fzf-native.nvim', + run = 'make' } } - -- Theme - use { "ellisonleao/gruvbox.nvim" } - -- File explorer - use { - 'nvim-tree/nvim-tree.lua', - requires = { - 'nvim-tree/nvim-web-devicons', -- optional, for file icons - }, - } - -- Icons - use('kyazdani42/nvim-web-devicons') - -- Highlighting - use('nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' }) - -- AST debugger - use('nvim-treesitter/playground') - -- File navigation "favorites" - use('ThePrimeagen/harpoon') - -- Undo history - use('mbbill/undotree') - -- Git support - use('tpope/vim-fugitive') - -- LSP - use { - 'VonHeikemen/lsp-zero.nvim', - requires = { - -- LSP Support - { 'neovim/nvim-lspconfig' }, - { 'williamboman/mason.nvim' }, - { 'williamboman/mason-lspconfig.nvim' }, + } + -- Theme + use { "ellisonleao/gruvbox.nvim" } + -- File explorer + use { + 'nvim-tree/nvim-tree.lua', + requires = { + 'nvim-tree/nvim-web-devicons', -- optional, for file icons + }, + } + -- Icons + use('kyazdani42/nvim-web-devicons') + -- Highlighting + use('nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' }) + -- AST debugger + use('nvim-treesitter/playground') + -- File navigation "favorites" + use('ThePrimeagen/harpoon') + -- Undo history + use('mbbill/undotree') + -- Git support + use('tpope/vim-fugitive') + -- LSP + use { + 'VonHeikemen/lsp-zero.nvim', + 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' }, + -- 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' }, - -- Snippets - { 'L3MON4D3/LuaSnip' }, - { 'rafamadriz/friendly-snippets' }, - } - } - -- Status line - use { - 'nvim-lualine/lualine.nvim', - requires = { 'kyazdani42/nvim-web-devicons', opt = true } } + } + -- Status line + use { + 'nvim-lualine/lualine.nvim', + requires = { 'kyazdani42/nvim-web-devicons', opt = true } + } - -- Automatically set up your configuration after cloning packer.nvim - -- Put this at the end after all plugins - if packer_bootstrap then - require('packer').sync() - end + -- Automatically set up your configuration after cloning packer.nvim + -- Put this at the end after all plugins + if packer_bootstrap then + require('packer').sync() + end end) From c62849f4555c5953c74ead27d259fd806457f9b2 Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Tue, 3 Jan 2023 09:59:02 +1100 Subject: [PATCH 06/27] Add vim-commentary and dropdown theme --- nvim/after/plugin/lsp.lua | 7 ++++--- nvim/after/plugin/telescope.lua | 9 ++++++++- nvim/lua/llago/packer.lua | 3 +++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/nvim/after/plugin/lsp.lua b/nvim/after/plugin/lsp.lua index 084a3aa..8c1083a 100644 --- a/nvim/after/plugin/lsp.lua +++ b/nvim/after/plugin/lsp.lua @@ -3,6 +3,7 @@ local lsp = require("lsp-zero") lsp.preset("recommended") lsp.ensure_installed({ + 'html', 'tsserver', 'eslint', 'sumneko_lua', @@ -63,9 +64,9 @@ lsp.on_attach(function(client, bufnr) vim.keymap.set("n", "vd", vim.diagnostic.open_float, opts) vim.keymap.set("n", "[d", vim.diagnostic.goto_next, opts) vim.keymap.set("n", "]d", vim.diagnostic.goto_prev, opts) - vim.keymap.set("n", "vca", vim.lsp.buf.code_action, opts) - vim.keymap.set("n", "vrr", vim.lsp.buf.references, opts) - vim.keymap.set("n", "vrn", vim.lsp.buf.rename, opts) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, opts) + vim.keymap.set("n", "rr", vim.lsp.buf.references, opts) + vim.keymap.set("n", "rn", vim.lsp.buf.rename, opts) vim.keymap.set("i", "", vim.lsp.buf.signature_help, opts) end) diff --git a/nvim/after/plugin/telescope.lua b/nvim/after/plugin/telescope.lua index 9c8287c..54e2aa0 100644 --- a/nvim/after/plugin/telescope.lua +++ b/nvim/after/plugin/telescope.lua @@ -6,7 +6,6 @@ vim.keymap.set('n', 'ps', function() end) vim.keymap.set('n', 'ag', builtin.live_grep, {}) - vim.keymap.set('n', 'b', builtin.buffers, {}) require('telescope').setup { @@ -18,6 +17,14 @@ require('telescope').setup { case_mode = "smart_case", -- or "ignore_case" or "respect_case" -- the default case_mode is "smart_case" } + }, + pickers = { + find_files = { + theme = 'dropdown' + }, + git_files = { + theme = 'dropdown' + } } } diff --git a/nvim/lua/llago/packer.lua b/nvim/lua/llago/packer.lua index 7f59a66..11a6ee6 100644 --- a/nvim/lua/llago/packer.lua +++ b/nvim/lua/llago/packer.lua @@ -73,6 +73,9 @@ return require('packer').startup(function(use) requires = { 'kyazdani42/nvim-web-devicons', opt = true } } + -- Comment + use('tpope/vim-commentary') + -- Automatically set up your configuration after cloning packer.nvim -- Put this at the end after all plugins From 09395088472dcaafdd37d5612b0baf434cb56b11 Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Tue, 3 Jan 2023 12:53:27 +1100 Subject: [PATCH 07/27] Use telescope for references --- nvim/after/plugin/lsp.lua | 38 ++++++++++++++++++++------------------ nvim/lua/llago/set.lua | 2 +- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/nvim/after/plugin/lsp.lua b/nvim/after/plugin/lsp.lua index 8c1083a..dcfa70e 100644 --- a/nvim/after/plugin/lsp.lua +++ b/nvim/after/plugin/lsp.lua @@ -12,18 +12,18 @@ lsp.ensure_installed({ -- Fix Undefined global 'vim' lsp.configure('sumneko_lua', { - settings = { - Lua = { - diagnostics = { - globals = { 'vim' } - } - } + settings = { + Lua = { + diagnostics = { + globals = { 'vim' } + } } + } }) local cmp = require('cmp') -local cmp_select = {behavior = cmp.SelectBehavior.Select} +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), @@ -41,21 +41,21 @@ lsp.setup_nvim_cmp({ }) lsp.set_preferences({ - suggest_lsp_servers = false, - sign_icons = { - error = 'E', - warn = 'W', - hint = 'H', - info = 'I' - } + suggest_lsp_servers = false, + sign_icons = { + error = 'E', + warn = 'W', + hint = 'H', + info = 'I' + } }) lsp.on_attach(function(client, bufnr) - local opts = {buffer = bufnr, remap = false} + local opts = { buffer = bufnr, remap = false } if client.name == "eslint" then - vim.cmd.LspStop('eslint') - return + vim.cmd.LspStop('eslint') + return end vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) @@ -68,10 +68,12 @@ lsp.on_attach(function(client, bufnr) vim.keymap.set("n", "rr", vim.lsp.buf.references, opts) vim.keymap.set("n", "rn", vim.lsp.buf.rename, opts) vim.keymap.set("i", "", vim.lsp.buf.signature_help, opts) + vim.keymap.set("n", "gr", require('telescope.builtin').lsp_references, opts) + -- nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') end) lsp.setup() vim.diagnostic.config({ - virtual_text = true, + virtual_text = true, }) diff --git a/nvim/lua/llago/set.lua b/nvim/lua/llago/set.lua index 7f601a9..48a63f1 100644 --- a/nvim/lua/llago/set.lua +++ b/nvim/lua/llago/set.lua @@ -22,7 +22,7 @@ vim.opt.isfname:append("@-@") vim.opt.updatetime = 50 -vim.opt.colorcolumn = "120" +-- vim.opt.colorcolumn = "120" vim.opt.clipboard = 'unnamedplus' vim.opt.cmdheight = 2 vim.opt.hidden = true From 27a4f7fa3aebefcaa57d9711e19a655b29234903 Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Tue, 3 Jan 2023 13:08:08 +1100 Subject: [PATCH 08/27] Add telescope ag extension --- nvim/lua/llago/packer.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nvim/lua/llago/packer.lua b/nvim/lua/llago/packer.lua index 11a6ee6..4e3e72e 100644 --- a/nvim/lua/llago/packer.lua +++ b/nvim/lua/llago/packer.lua @@ -76,6 +76,8 @@ return require('packer').startup(function(use) -- Comment use('tpope/vim-commentary') + -- Ag + use({ "kelly-lin/telescope-ag", requires = { { "nvim-telescope/telescope.nvim" } } }) -- Automatically set up your configuration after cloning packer.nvim -- Put this at the end after all plugins From a2ae98a4803900a6bb942b8b1f2cea77acd81ce7 Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Tue, 3 Jan 2023 21:47:06 +1100 Subject: [PATCH 09/27] Fix lsp shut down on new buffers --- nvim/after/plugin/lsp.lua | 9 ++++----- nvim/lua/llago/set.lua | 1 - 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/nvim/after/plugin/lsp.lua b/nvim/after/plugin/lsp.lua index dcfa70e..3d6d2d0 100644 --- a/nvim/after/plugin/lsp.lua +++ b/nvim/after/plugin/lsp.lua @@ -53,10 +53,10 @@ lsp.set_preferences({ lsp.on_attach(function(client, bufnr) local opts = { buffer = bufnr, remap = false } - if client.name == "eslint" then - vim.cmd.LspStop('eslint') - return - end + -- if client.name == "eslint" then + -- vim.cmd.LspStop('eslint') + -- return + -- end vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) @@ -69,7 +69,6 @@ lsp.on_attach(function(client, bufnr) vim.keymap.set("n", "rn", vim.lsp.buf.rename, opts) vim.keymap.set("i", "", vim.lsp.buf.signature_help, opts) vim.keymap.set("n", "gr", require('telescope.builtin').lsp_references, opts) - -- nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') end) lsp.setup() diff --git a/nvim/lua/llago/set.lua b/nvim/lua/llago/set.lua index 48a63f1..7fe5dfa 100644 --- a/nvim/lua/llago/set.lua +++ b/nvim/lua/llago/set.lua @@ -13,7 +13,6 @@ vim.opt.backup = false vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" vim.opt.undofile = true - vim.opt.termguicolors = true vim.opt.scrolloff = 8 From e54a538340580f87c459c4eb1f096dedb2c18a6d Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Wed, 4 Jan 2023 09:20:28 +1100 Subject: [PATCH 10/27] Add format autocmd --- nvim/after/plugin/lsp.lua | 9 +++------ nvim/lua/llago/autocmd.lua | 5 +++++ nvim/lua/llago/init.lua | 1 + 3 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 nvim/lua/llago/autocmd.lua diff --git a/nvim/after/plugin/lsp.lua b/nvim/after/plugin/lsp.lua index 3d6d2d0..a76feef 100644 --- a/nvim/after/plugin/lsp.lua +++ b/nvim/after/plugin/lsp.lua @@ -53,12 +53,7 @@ lsp.set_preferences({ lsp.on_attach(function(client, bufnr) local opts = { buffer = bufnr, remap = false } - -- if client.name == "eslint" then - -- vim.cmd.LspStop('eslint') - -- return - -- end - - vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) + -- vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) vim.keymap.set("n", "vws", vim.lsp.buf.workspace_symbol, opts) vim.keymap.set("n", "vd", vim.diagnostic.open_float, opts) @@ -69,6 +64,8 @@ lsp.on_attach(function(client, bufnr) vim.keymap.set("n", "rn", vim.lsp.buf.rename, opts) vim.keymap.set("i", "", vim.lsp.buf.signature_help, opts) vim.keymap.set("n", "gr", require('telescope.builtin').lsp_references, opts) + vim.keymap.set("n", "gi", require('telescope.builtin').lsp_implementations, opts) + vim.keymap.set("n", "gd", require('telescope.builtin').lsp_definitions, opts) end) lsp.setup() diff --git a/nvim/lua/llago/autocmd.lua b/nvim/lua/llago/autocmd.lua new file mode 100644 index 0000000..221c44d --- /dev/null +++ b/nvim/lua/llago/autocmd.lua @@ -0,0 +1,5 @@ +vim.api.nvim_create_autocmd('BufWritePre', { + pattern = { '*.tsx', '*.ts', '*.jsx', '*.js' }, + command = 'silent! EslintFixAll', + group = vim.api.nvim_create_augroup('MyAutocmdsJavaScripFormatting', {}), +}) diff --git a/nvim/lua/llago/init.lua b/nvim/lua/llago/init.lua index e7516bf..a783fca 100644 --- a/nvim/lua/llago/init.lua +++ b/nvim/lua/llago/init.lua @@ -1,3 +1,4 @@ require("llago.remap") require("llago.packer") require("llago.set") +require("llago.autocmd") From 88deef205524c8af0cb22584e5818d8a893ba696 Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Wed, 4 Jan 2023 12:07:16 +1100 Subject: [PATCH 11/27] Show errrs on hover --- nvim/after/plugin/lsp.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/nvim/after/plugin/lsp.lua b/nvim/after/plugin/lsp.lua index a76feef..7e591e7 100644 --- a/nvim/after/plugin/lsp.lua +++ b/nvim/after/plugin/lsp.lua @@ -53,6 +53,21 @@ lsp.set_preferences({ lsp.on_attach(function(client, bufnr) local opts = { buffer = bufnr, remap = false } + vim.api.nvim_create_autocmd("CursorHold", { + buffer = bufnr, + callback = function() + local cursorHoldOpts = { + focusable = false, + close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" }, + border = 'rounded', + source = 'always', + prefix = ' ', + scope = 'cursor', + } + vim.diagnostic.open_float(nil, cursorHoldOpts) + end + }) + -- vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) vim.keymap.set("n", "vws", vim.lsp.buf.workspace_symbol, opts) From 5c00f15f44b09cc45cbb43358ca2ee83a6b77d5f Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Thu, 5 Jan 2023 10:27:35 +1100 Subject: [PATCH 12/27] Fix a bunch of nits I found while coding --- nvim/after/plugin/lsp.lua | 32 ++++++++++++++++---------------- nvim/after/plugin/telescope.lua | 7 +++++-- nvim/lua/llago/packer.lua | 6 +++--- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/nvim/after/plugin/lsp.lua b/nvim/after/plugin/lsp.lua index 7e591e7..1d75d37 100644 --- a/nvim/after/plugin/lsp.lua +++ b/nvim/after/plugin/lsp.lua @@ -33,8 +33,8 @@ local cmp_mappings = lsp.defaults.cmp_mappings({ -- disable completion with tab -- this helps with copilot setup -cmp_mappings[''] = nil -cmp_mappings[''] = nil +-- cmp_mappings[''] = nil +-- cmp_mappings[''] = nil lsp.setup_nvim_cmp({ mapping = cmp_mappings @@ -53,20 +53,20 @@ lsp.set_preferences({ lsp.on_attach(function(client, bufnr) local opts = { buffer = bufnr, remap = false } - vim.api.nvim_create_autocmd("CursorHold", { - buffer = bufnr, - callback = function() - local cursorHoldOpts = { - focusable = false, - close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" }, - border = 'rounded', - source = 'always', - prefix = ' ', - scope = 'cursor', - } - vim.diagnostic.open_float(nil, cursorHoldOpts) - end - }) + -- vim.api.nvim_create_autocmd("CursorHold", { + -- buffer = bufnr, + -- callback = function() + -- local cursorHoldOpts = { + -- focusable = false, + -- close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" }, + -- border = 'rounded', + -- source = 'always', + -- prefix = ' ', + -- scope = 'cursor', + -- } + -- vim.diagnostic.open_float(nil, cursorHoldOpts) + -- end + -- }) -- vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) diff --git a/nvim/after/plugin/telescope.lua b/nvim/after/plugin/telescope.lua index 54e2aa0..f6d91ce 100644 --- a/nvim/after/plugin/telescope.lua +++ b/nvim/after/plugin/telescope.lua @@ -1,6 +1,6 @@ local builtin = require('telescope.builtin') -vim.keymap.set('n', 'pf', builtin.find_files, {}) -vim.keymap.set('n', '', builtin.git_files, {}) +vim.keymap.set('n', 'pf', builtin.git_files, {}) +vim.keymap.set('n', '', builtin.find_files, {}) vim.keymap.set('n', 'ps', function() builtin.grep_string({ search = vim.fn.input("Grep > ") }); end) @@ -9,6 +9,9 @@ vim.keymap.set('n', 'ag', builtin.live_grep, {}) vim.keymap.set('n', 'b', builtin.buffers, {}) require('telescope').setup { + defaults = { + path_display={"truncate"} + }, extensions = { fzf = { fuzzy = true, -- false will only do exact matching diff --git a/nvim/lua/llago/packer.lua b/nvim/lua/llago/packer.lua index 4e3e72e..bf2f885 100644 --- a/nvim/lua/llago/packer.lua +++ b/nvim/lua/llago/packer.lua @@ -73,11 +73,11 @@ return require('packer').startup(function(use) requires = { 'kyazdani42/nvim-web-devicons', opt = true } } - -- Comment + -- Language agnostic comments use('tpope/vim-commentary') - -- Ag - use({ "kelly-lin/telescope-ag", requires = { { "nvim-telescope/telescope.nvim" } } }) + -- Auto insertion of closing tags + use('Raimondi/delimitMate') -- Automatically set up your configuration after cloning packer.nvim -- Put this at the end after all plugins From 99f0b69d9c6bc3c3499dbaa4f81a692fca08436d Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Mon, 9 Jan 2023 13:50:35 +1100 Subject: [PATCH 13/27] Moar plugins --- nvim/after/plugin/lsp.lua | 5 ++++- nvim/after/plugin/treesitter.lua | 9 +++++++++ nvim/lua/llago/packer.lua | 8 ++++++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/nvim/after/plugin/lsp.lua b/nvim/after/plugin/lsp.lua index 1d75d37..71ba15c 100644 --- a/nvim/after/plugin/lsp.lua +++ b/nvim/after/plugin/lsp.lua @@ -30,6 +30,8 @@ local cmp_mappings = lsp.defaults.cmp_mappings({ [''] = cmp.mapping.confirm({ select = true }), [""] = cmp.mapping.complete(), }) +local cmp_sources = lsp.defaults.cmp_sources() +table.insert(cmp_sources, { name = 'nvim_lsp_signature_help' }) -- disable completion with tab -- this helps with copilot setup @@ -37,7 +39,8 @@ local cmp_mappings = lsp.defaults.cmp_mappings({ -- cmp_mappings[''] = nil lsp.setup_nvim_cmp({ - mapping = cmp_mappings + mapping = cmp_mappings, + sources = cmp_sources }) lsp.set_preferences({ diff --git a/nvim/after/plugin/treesitter.lua b/nvim/after/plugin/treesitter.lua index 3079a90..84bf3de 100644 --- a/nvim/after/plugin/treesitter.lua +++ b/nvim/after/plugin/treesitter.lua @@ -18,5 +18,14 @@ require'nvim-treesitter.configs'.setup { -- Using this option may slow down your editor, and you may see some duplicate highlights. -- Instead of true it can also be a list of languages additional_vim_regex_highlighting = false, + + -- Disable highlight in big files + disable = function(lang, buf) + local max_filesize = 100 * 1024 -- 100 KB + local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) + if ok and stats and stats.size > max_filesize then + return true + end + end, }, } diff --git a/nvim/lua/llago/packer.lua b/nvim/lua/llago/packer.lua index bf2f885..fabcc75 100644 --- a/nvim/lua/llago/packer.lua +++ b/nvim/lua/llago/packer.lua @@ -45,8 +45,7 @@ return require('packer').startup(function(use) -- Git support use('tpope/vim-fugitive') -- LSP - use { - 'VonHeikemen/lsp-zero.nvim', + use { 'VonHeikemen/lsp-zero.nvim', requires = { -- LSP Support { 'neovim/nvim-lspconfig' }, @@ -60,6 +59,8 @@ return require('packer').startup(function(use) { 'saadparwaiz1/cmp_luasnip' }, { 'hrsh7th/cmp-nvim-lsp' }, { 'hrsh7th/cmp-nvim-lua' }, + -- Help signatures for function parameters in insert + {'hrsh7th/cmp-nvim-lsp-signature-help'}, -- Snippets { 'L3MON4D3/LuaSnip' }, @@ -79,6 +80,9 @@ return require('packer').startup(function(use) -- Auto insertion of closing tags use('Raimondi/delimitMate') + -- Keybinding previews on popup + use('folke/which-key.nvim') + -- Automatically set up your configuration after cloning packer.nvim -- Put this at the end after all plugins if packer_bootstrap then From edbb3167be3b1f7a0ea7de9c2594ac5356e96a33 Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Wed, 18 Jan 2023 23:25:06 +1100 Subject: [PATCH 14/27] add css lsp --- nvim/after/plugin/lsp.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/nvim/after/plugin/lsp.lua b/nvim/after/plugin/lsp.lua index 71ba15c..fc96f11 100644 --- a/nvim/after/plugin/lsp.lua +++ b/nvim/after/plugin/lsp.lua @@ -8,6 +8,7 @@ lsp.ensure_installed({ 'eslint', 'sumneko_lua', 'rust_analyzer', + 'cssls', }) -- Fix Undefined global 'vim' From a0a01f5f2c37e35ff07e7c3f2a46e9a15b7ea927 Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Wed, 18 Jan 2023 23:25:24 +1100 Subject: [PATCH 15/27] Add which key config --- nvim/after/plugin/whichkey.lua | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 nvim/after/plugin/whichkey.lua diff --git a/nvim/after/plugin/whichkey.lua b/nvim/after/plugin/whichkey.lua new file mode 100644 index 0000000..e724386 --- /dev/null +++ b/nvim/after/plugin/whichkey.lua @@ -0,0 +1,5 @@ +require("which-key").setup { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below +} From 493aa4d5d82b1cdd83dba7fc69379e06a4283d46 Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Thu, 23 Feb 2023 14:09:43 +1100 Subject: [PATCH 16/27] Add sorting to telescope --- Brewfile | 1 + nvim/after/plugin/telescope.lua | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Brewfile b/Brewfile index 069bed1..2ed668e 100644 --- a/Brewfile +++ b/Brewfile @@ -28,3 +28,4 @@ cask "docker" cask "rectangle" cask "spotify" cask "keycastr" +cask "graphiql" diff --git a/nvim/after/plugin/telescope.lua b/nvim/after/plugin/telescope.lua index f6d91ce..8615294 100644 --- a/nvim/after/plugin/telescope.lua +++ b/nvim/after/plugin/telescope.lua @@ -22,6 +22,10 @@ require('telescope').setup { } }, pickers = { + buffers = { + sort_mru = true, + ignore_current_buffer = true, + }, find_files = { theme = 'dropdown' }, From 012cc2e8d78176dee82f2cad638d08fd5ce5b416 Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Mon, 6 Mar 2023 10:26:35 +1100 Subject: [PATCH 17/27] Rename lua lsp --- nvim/after/plugin/lsp.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nvim/after/plugin/lsp.lua b/nvim/after/plugin/lsp.lua index fc96f11..95328f1 100644 --- a/nvim/after/plugin/lsp.lua +++ b/nvim/after/plugin/lsp.lua @@ -6,13 +6,13 @@ lsp.ensure_installed({ 'html', 'tsserver', 'eslint', - 'sumneko_lua', + 'lua_ls', 'rust_analyzer', 'cssls', }) -- Fix Undefined global 'vim' -lsp.configure('sumneko_lua', { +lsp.configure('lua_ls', { settings = { Lua = { diagnostics = { From db9a5ae1d5fc9deb2581f289c1c21b3d8373e598 Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Mon, 6 Mar 2023 10:26:49 +1100 Subject: [PATCH 18/27] Truncate telescope --- nvim/after/plugin/telescope.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/nvim/after/plugin/telescope.lua b/nvim/after/plugin/telescope.lua index 8615294..e9d84a2 100644 --- a/nvim/after/plugin/telescope.lua +++ b/nvim/after/plugin/telescope.lua @@ -10,7 +10,17 @@ vim.keymap.set('n', 'b', builtin.buffers, {}) require('telescope').setup { defaults = { - path_display={"truncate"} + path_display={"truncate"}, + preview = { + filesize_limit = 1, + filesize_hook = function(filepath, bufnr, opts) + local path = require("plenary.path"):new(filepath) + -- opts exposes winid + local height = vim.api.nvim_win_get_height(opts.winid) + local lines = vim.split(path:head(height), "[\r]?\n") + vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, lines) + end, + } }, extensions = { fzf = { From bad0b3000584d79afb6c16c9f4b1b6cbf322c516 Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Sat, 22 Apr 2023 20:36:50 +1000 Subject: [PATCH 19/27] Add pomodoro plugin --- nvim/after/plugin/dap.lua | 33 +++++++++++++++++++++++++++++++++ nvim/after/plugin/lualine.lua | 7 ++++++- nvim/after/plugin/telescope.lua | 8 +++----- nvim/lua/llago/packer.lua | 8 ++++++++ 4 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 nvim/after/plugin/dap.lua diff --git a/nvim/after/plugin/dap.lua b/nvim/after/plugin/dap.lua new file mode 100644 index 0000000..708ecf1 --- /dev/null +++ b/nvim/after/plugin/dap.lua @@ -0,0 +1,33 @@ +-- local dap = require('dap') + +-- dap.adapters.chrome = { +-- type = "executable", +-- command = "node", +-- args = {os.getenv("HOME") .. "/path/to/vscode-chrome-debug/out/src/chromeDebug.js"} -- TODO adjust +-- } + +-- dap.configurations.javascriptreact = { -- change this to javascript if needed +-- { +-- type = "chrome", +-- request = "attach", +-- program = "${file}", +-- cwd = vim.fn.getcwd(), +-- sourceMaps = true, +-- protocol = "inspector", +-- port = 9222, +-- webRoot = "${workspaceFolder}" +-- } +-- } + +-- dap.configurations.typescriptreact = { -- change to typescript if needed +-- { +-- type = "chrome", +-- request = "attach", +-- program = "${file}", +-- cwd = vim.fn.getcwd(), +-- sourceMaps = true, +-- protocol = "inspector", +-- port = 9222, +-- webRoot = "${workspaceFolder}" +-- } +-- } diff --git a/nvim/after/plugin/lualine.lua b/nvim/after/plugin/lualine.lua index bcb76db..0be259b 100644 --- a/nvim/after/plugin/lualine.lua +++ b/nvim/after/plugin/lualine.lua @@ -1 +1,6 @@ -require('lualine').setup({ theme = 'gruvbox' }) +require('lualine').setup({ + theme = 'gruvbox', + sections = { + lualine_c = { 'filename', require('pomodoro').statusline } + } +}) diff --git a/nvim/after/plugin/telescope.lua b/nvim/after/plugin/telescope.lua index e9d84a2..870748c 100644 --- a/nvim/after/plugin/telescope.lua +++ b/nvim/after/plugin/telescope.lua @@ -14,11 +14,9 @@ require('telescope').setup { preview = { filesize_limit = 1, filesize_hook = function(filepath, bufnr, opts) - local path = require("plenary.path"):new(filepath) - -- opts exposes winid - local height = vim.api.nvim_win_get_height(opts.winid) - local lines = vim.split(path:head(height), "[\r]?\n") - vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, lines) + local max_bytes = 10000 + local cmd = {"head", "-c", max_bytes, filepath} + require('telescope.previewers.utils').job_maker(cmd, bufnr, opts) end, } }, diff --git a/nvim/lua/llago/packer.lua b/nvim/lua/llago/packer.lua index fabcc75..8ade811 100644 --- a/nvim/lua/llago/packer.lua +++ b/nvim/lua/llago/packer.lua @@ -83,6 +83,14 @@ return require('packer').startup(function(use) -- Keybinding previews on popup use('folke/which-key.nvim') + -- Debugger client + use 'mfussenegger/nvim-dap' + + -- Pomodoro + use { + 'wthollingsworth/pomodoro.nvim', + requires = 'MunifTanjim/nui.nvim' + } -- Automatically set up your configuration after cloning packer.nvim -- Put this at the end after all plugins if packer_bootstrap then From 678b649967dfcf74b48fde8191470d111c099d94 Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Mon, 24 Apr 2023 17:47:53 +1000 Subject: [PATCH 20/27] Update macos bootstrap script --- .gitignore | 1 + macos-bootstrap.sh | 27 +++++++-------------------- nvim/after/plugin/treesitter.lua | 2 +- 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index 55acb54..9f709c3 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ Brewfile.lock.json +nvim/plugin/packer_* diff --git a/macos-bootstrap.sh b/macos-bootstrap.sh index 0573205..dfd500a 100644 --- a/macos-bootstrap.sh +++ b/macos-bootstrap.sh @@ -8,20 +8,11 @@ if [[ ! -e /usr/local/bin/z.sh ]]; then sudo cp ./z/z.sh /usr/local/bin && rm -rf ./z fi -VIM_PLUG_FILE="${HOME}/.vim/autoload/plug.vim" -if [ ! -f "${VIM_PLUG_FILE}" ]; then - echo "==> Installing vim plug" - curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ - https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim - echo " ==> Vim plugins will be installed on vim startup" -fi - -NEOVIM_PLUG_FILE="${HOME}/.local/share/nvim/site/autoload/plug.vim" -if [ ! -f "${NEOVIM_PLUG_FILE}" ]; then - echo "==> Installing neovim plug" - sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \ - https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' - echo "==> Neovim plugins will be installed on nvim startup" +PACKER_DIST="${HOME}/.local/share/nvim/site/pack/packer/start/packer.nvim" +if [ ! -d "${PACKER_DIST}" ]; then + echo "==> Installing Packer" + git clone --depth 1 https://github.com/wbthomason/packer.nvim\ + ~/.local/share/nvim/site/pack/packer/start/packer.nvim fi if [ ! -d "${HOME}/.oh-my-zsh" ]; then @@ -42,16 +33,13 @@ mkdir -p ~/Development echo "==> Setting up dotfiles" git remote set-url origin git@github.com:lucaslago/dotfiles.git -ln -sf $(pwd)/vimrc "${HOME}/.vimrc" - -mkdir -p "${HOME}/.config/nvim" && ln -sf $(pwd)/init.vim "${HOME}/.config/nvim/init.vim" && ln -sf $(pwd)/coc-settings.json "${HOME}/.config/nvim/coc-settings.json" - ln -sf $(pwd)/zshrc "${HOME}/.zshrc" ln -sf $(pwd)/tmux.conf "${HOME}/.tmux.conf" ln -sf $(pwd)/tmate.conf "${HOME}/.tmate.conf" ln -sf $(pwd)/gitconfig "${HOME}/.gitconfig" +ln -s "$(pwd)/nvim" "${HOME}/.config/nvim" -mkdir -p "${HOME}/.config/coc/extensions" && ln -sf $(pwd)/coc-nvim/package.json "$HOME/.config/coc/extensions/package.json" && (cd "$HOME/.config/coc/extensions" && npm install --global-style --ignore-scripts --no-bin-links --no-package-lock --only=prod) +mkdir -p "${HOME}/.config/coc/extensions" if [ ! -d "${HOME}/.tmux/plugins" ]; then echo " ==> Installing tmux plugins" @@ -59,7 +47,6 @@ if [ ! -d "${HOME}/.tmux/plugins" ]; then ${HOME}/.tmux/plugins/tpm/bin/install_plugins fi - if ! command -v graphql-lsp > /dev/null; then echo "==> Installing graphql-lsp" npm install --global graphql-language-service-cli diff --git a/nvim/after/plugin/treesitter.lua b/nvim/after/plugin/treesitter.lua index 84bf3de..a20417d 100644 --- a/nvim/after/plugin/treesitter.lua +++ b/nvim/after/plugin/treesitter.lua @@ -1,6 +1,6 @@ require'nvim-treesitter.configs'.setup { -- A list of parser names, or "all" - ensure_installed = { "help", "c", "lua", "rust", "javascript", "typescript", "go", "vim"}, + ensure_installed = { "c", "lua", "rust", "javascript", "typescript", "go", "vim"}, -- Install parsers synchronously (only applied to `ensure_installed`) sync_install = false, From 25fc303a360c0cca232ae894bb48400be188e926 Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Thu, 27 Apr 2023 10:59:18 +1000 Subject: [PATCH 21/27] re-enable tmux plugin manager --- tmux.conf | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tmux.conf b/tmux.conf index 552a253..74f8f6d 100644 --- a/tmux.conf +++ b/tmux.conf @@ -59,13 +59,6 @@ set -g mouse on # don't rename windows automatically set-option -g allow-rename off -# List of plugins -# set -g @plugin 'tmux-plugins/tpm' -# set -g @plugin 'egel/tmux-gruvbox' -# set -g @plugin 'tmux-plugins/tmux-yank' -# set -g @plugin 'tmux-plugins/tmux-prefix-highlight' - - # 0 is too far from ` ;) set -g base-index 1 # Loud or quiet? @@ -113,4 +106,7 @@ set-option -g status-right "#[bg=colour237,fg=colour239 nobold, nounderscore, no set-window-option -g window-status-current-format "#[bg=colour214,fg=colour237,nobold,noitalics,nounderscore]#[bg=colour214,fg=colour239] #I #[bg=colour214,fg=colour239,bold] #W#{?window_zoomed_flag,*Z,} #[bg=colour237,fg=colour214,nobold,noitalics,nounderscore]" set-window-option -g window-status-format "#[bg=colour239,fg=colour237,noitalics]#[bg=colour239,fg=colour223] #I #[bg=colour239,fg=colour223] #W #[bg=colour237,fg=colour239,noitalics]" -# run -b '~/.tmux/plugins/tpm/tpm' +# Keep at bottom +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +run '~/.tmux/plugins/tpm/tpm' From afc90882703ec166286325fab913a7d0680c8cc2 Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Mon, 3 Jul 2023 11:01:56 +1000 Subject: [PATCH 22/27] Setup github copilot --- gitconfig | 4 ++-- nvim/after/plugin/lsp.lua | 4 ++-- nvim/lua/llago/packer.lua | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gitconfig b/gitconfig index f4c8639..a66d3d7 100644 --- a/gitconfig +++ b/gitconfig @@ -13,10 +13,10 @@ default = current [pull] rebase = false +[init] + defaultBranch = main [filter "lfs"] required = true clean = git-lfs clean -- %f smudge = git-lfs smudge -- %f process = git-lfs filter-process -[init] - defaultBranch = main diff --git a/nvim/after/plugin/lsp.lua b/nvim/after/plugin/lsp.lua index 95328f1..51561b1 100644 --- a/nvim/after/plugin/lsp.lua +++ b/nvim/after/plugin/lsp.lua @@ -36,8 +36,8 @@ table.insert(cmp_sources, { name = 'nvim_lsp_signature_help' }) -- disable completion with tab -- this helps with copilot setup --- cmp_mappings[''] = nil --- cmp_mappings[''] = nil +cmp_mappings[''] = nil +cmp_mappings[''] = nil lsp.setup_nvim_cmp({ mapping = cmp_mappings, diff --git a/nvim/lua/llago/packer.lua b/nvim/lua/llago/packer.lua index 8ade811..5d4589c 100644 --- a/nvim/lua/llago/packer.lua +++ b/nvim/lua/llago/packer.lua @@ -91,6 +91,10 @@ return require('packer').startup(function(use) 'wthollingsworth/pomodoro.nvim', requires = 'MunifTanjim/nui.nvim' } + + use { + 'github/copilot.vim' + } -- Automatically set up your configuration after cloning packer.nvim -- Put this at the end after all plugins if packer_bootstrap then From fd9aeb8d8563b353e7ddf0de62add8a40de5286d Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Fri, 7 Jul 2023 11:19:34 +1000 Subject: [PATCH 23/27] Add iterm2 config --- com.googlecode.iterm2.plist | 1046 +++++++++++++++++++++++++++++++++++ 1 file changed, 1046 insertions(+) create mode 100644 com.googlecode.iterm2.plist diff --git a/com.googlecode.iterm2.plist b/com.googlecode.iterm2.plist new file mode 100644 index 0000000..8ebdfa8 --- /dev/null +++ b/com.googlecode.iterm2.plist @@ -0,0 +1,1046 @@ + + + + + AllowClipboardAccess + + AppleAntiAliasingThreshold + 1 + ApplePressAndHoldEnabled + + AppleScrollAnimationEnabled + 0 + AppleSmoothFixedFontsSizeThreshold + 1 + AppleWindowTabbingMode + manual + Custom Color Presets + + Gruvbox Dark + + Ansi 0 Color + + Blue Component + 0.15686274509803921 + Green Component + 0.15686274509803921 + Red Component + 0.15686274509803921 + + Ansi 1 Color + + Blue Component + 0.11372549019607843 + Green Component + 0.14117647058823529 + Red Component + 0.80000000000000004 + + Ansi 10 Color + + Blue Component + 0.14901960784313725 + Green Component + 0.73333333333333328 + Red Component + 0.72156862745098038 + + Ansi 11 Color + + Blue Component + 0.18431372549019609 + Green Component + 0.74117647058823533 + Red Component + 0.98039215686274506 + + Ansi 12 Color + + Blue Component + 0.59607843137254901 + Green Component + 0.6470588235294118 + Red Component + 0.51372549019607838 + + Ansi 13 Color + + Blue Component + 0.60784313725490191 + Green Component + 0.52549019607843139 + Red Component + 0.82745098039215681 + + Ansi 14 Color + + Blue Component + 0.48627450980392156 + Green Component + 0.75294117647058822 + Red Component + 0.55686274509803924 + + Ansi 2 Color + + Blue Component + 0.10196078431372549 + Green Component + 0.59215686274509804 + Red Component + 0.59607843137254901 + + Ansi 3 Color + + Blue Component + 0.12941176470588237 + Green Component + 0.59999999999999998 + Red Component + 0.84313725490196079 + + Ansi 4 Color + + Blue Component + 0.53333333333333333 + Green Component + 0.52156862745098043 + Red Component + 0.27058823529411763 + + Ansi 5 Color + + Blue Component + 0.52549019607843139 + Green Component + 0.3843137254901961 + Red Component + 0.69411764705882351 + + Ansi 6 Color + + Blue Component + 0.41568627450980394 + Green Component + 0.61568627450980395 + Red Component + 0.40784313725490196 + + Ansi 7 Color + + Blue Component + 0.51764705882352946 + Green Component + 0.59999999999999998 + Red Component + 0.6588235294117647 + + Ansi 8 Color + + Blue Component + 0.45490196078431372 + Green Component + 0.51372549019607838 + Red Component + 0.5725490196078431 + + Ansi 9 Color + + Blue Component + 0.20392156862745098 + Green Component + 0.28627450980392155 + Red Component + 0.98431372549019602 + + Background Color + + Blue Component + 0.15686274509803921 + Green Component + 0.15686274509803921 + Red Component + 0.15686274509803921 + + Foreground Color + + Blue Component + 0.69803921568627447 + Green Component + 0.85882352941176465 + Red Component + 0.92156862745098034 + + + + Default Bookmark Guid + E756D64B-FFAE-4ACF-9AA9-FC2ACB21AD39 + DisableFullscreenTransparency + + HapticFeedbackForEsc + + HideScrollbar + + HotkeyMigratedFromSingleToMulti + + New Bookmarks + + + ASCII Anti Aliased + + Ambiguous Double Width + + Ansi 0 Color + + Blue Component + 0.15686274509803921 + Green Component + 0.15686274509803921 + Red Component + 0.15686274509803921 + + Ansi 1 Color + + Blue Component + 0.11372549019607843 + Green Component + 0.14117647058823529 + Red Component + 0.80000000000000004 + + Ansi 10 Color + + Blue Component + 0.14901960784313725 + Green Component + 0.73333333333333328 + Red Component + 0.72156862745098038 + + Ansi 11 Color + + Blue Component + 0.18431372549019609 + Green Component + 0.74117647058823533 + Red Component + 0.98039215686274506 + + Ansi 12 Color + + Blue Component + 0.59607843137254901 + Green Component + 0.6470588235294118 + Red Component + 0.51372549019607838 + + Ansi 13 Color + + Blue Component + 0.60784313725490191 + Green Component + 0.52549019607843139 + Red Component + 0.82745098039215681 + + Ansi 14 Color + + Blue Component + 0.48627450980392156 + Green Component + 0.75294117647058822 + Red Component + 0.55686274509803924 + + Ansi 15 Color + + Alpha Component + 1 + Blue Component + 0.99999994039535522 + Color Space + sRGB + Green Component + 0.99999994039535522 + Red Component + 1 + + Ansi 2 Color + + Blue Component + 0.10196078431372549 + Green Component + 0.59215686274509804 + Red Component + 0.59607843137254901 + + Ansi 3 Color + + Blue Component + 0.12941176470588237 + Green Component + 0.59999999999999998 + Red Component + 0.84313725490196079 + + Ansi 4 Color + + Blue Component + 0.53333333333333333 + Green Component + 0.52156862745098043 + Red Component + 0.27058823529411763 + + Ansi 5 Color + + Blue Component + 0.52549019607843139 + Green Component + 0.3843137254901961 + Red Component + 0.69411764705882351 + + Ansi 6 Color + + Blue Component + 0.41568627450980394 + Green Component + 0.61568627450980395 + Red Component + 0.40784313725490196 + + Ansi 7 Color + + Blue Component + 0.51764705882352946 + Green Component + 0.59999999999999998 + Red Component + 0.6588235294117647 + + Ansi 8 Color + + Blue Component + 0.45490196078431372 + Green Component + 0.51372549019607838 + Red Component + 0.5725490196078431 + + Ansi 9 Color + + Blue Component + 0.20392156862745098 + Green Component + 0.28627450980392155 + Red Component + 0.98431372549019602 + + BM Growl + + Background Color + + Blue Component + 0.15686274509803921 + Green Component + 0.15686274509803921 + Red Component + 0.15686274509803921 + + Background Image Location + + Badge Color + + Alpha Component + 0.5 + Blue Component + 0.0 + Color Space + sRGB + Green Component + 0.14910027384757996 + Red Component + 1 + + Blinking Cursor + + Blur + + Bold Color + + Alpha Component + 1 + Blue Component + 0.99999994039535522 + Color Space + sRGB + Green Component + 0.99999994039535522 + Red Component + 1 + + Character Encoding + 4 + Close Sessions On End + + Columns + 80 + Command + + Cursor Color + + Alpha Component + 1 + Blue Component + 0.7807578444480896 + Color Space + sRGB + Green Component + 0.78075778484344482 + Red Component + 0.7807578444480896 + + Cursor Guide Color + + Alpha Component + 0.25 + Blue Component + 1 + Color Space + sRGB + Green Component + 0.92681378126144409 + Red Component + 0.70214027166366577 + + Cursor Text Color + + Alpha Component + 1 + Blue Component + 0.99999994039535522 + Color Space + sRGB + Green Component + 0.99999994039535522 + Red Component + 1 + + Custom Command + No + Custom Directory + No + Default Bookmark + No + Description + Default + Disable Window Resizing + + Flashing Bell + + Foreground Color + + Blue Component + 0.69803921568627447 + Green Component + 0.85882352941176465 + Red Component + 0.92156862745098034 + + Guid + E756D64B-FFAE-4ACF-9AA9-FC2ACB21AD39 + Horizontal Spacing + 1 + Idle Code + 0 + Jobs to Ignore + + rlogin + ssh + slogin + telnet + + Keyboard Map + + 0x2a-0x200000 + + Action + 12 + Text + * + + 0x2b-0x200000 + + Action + 12 + Text + + + + 0x2d-0x200000 + + Action + 12 + Text + - + + 0x2d-0x40000 + + Action + 11 + Text + 0x1f + + 0x2e-0x200000 + + Action + 12 + Text + . + + 0x2f-0x200000 + + Action + 12 + Text + / + + 0x3-0x200000 + + Action + 11 + Text + 0xd + + 0x30-0x200000 + + Action + 12 + Text + 0 + + 0x31-0x200000 + + Action + 12 + Text + 1 + + 0x32-0x200000 + + Action + 12 + Text + 2 + + 0x32-0x40000 + + Action + 11 + Text + 0x00 + + 0x33-0x200000 + + Action + 12 + Text + 3 + + 0x33-0x40000 + + Action + 11 + Text + 0x1b + + 0x34-0x200000 + + Action + 12 + Text + 4 + + 0x34-0x40000 + + Action + 11 + Text + 0x1c + + 0x35-0x200000 + + Action + 12 + Text + 5 + + 0x35-0x40000 + + Action + 11 + Text + 0x1d + + 0x36-0x200000 + + Action + 12 + Text + 6 + + 0x36-0x40000 + + Action + 11 + Text + 0x1e + + 0x37-0x200000 + + Action + 12 + Text + 7 + + 0x37-0x40000 + + Action + 11 + Text + 0x1f + + 0x38-0x200000 + + Action + 12 + Text + 8 + + 0x38-0x40000 + + Action + 11 + Text + 0x7f + + 0x39-0x200000 + + Action + 12 + Text + 9 + + 0x7f-0x100000 + + Action + 11 + Text + 0x15 + + 0x7f-0x80000 + + Action + 11 + Text + 0x1b 0x7f + + 0xf700-0x220000 + + Action + 10 + Text + [1;2A + + 0xf700-0x240000 + + Action + 10 + Text + [1;5A + + 0xf700-0x260000 + + Action + 10 + Text + [1;6A + + 0xf701-0x220000 + + Action + 10 + Text + [1;2B + + 0xf701-0x240000 + + Action + 10 + Text + [1;5B + + 0xf701-0x260000 + + Action + 10 + Text + [1;6B + + 0xf702-0x220000 + + Action + 10 + Text + [1;2D + + 0xf702-0x240000 + + Action + 10 + Text + [1;5D + + 0xf702-0x260000 + + Action + 10 + Text + [1;6D + + 0xf702-0x280000 + + Action + 10 + Text + b + + 0xf702-0x300000 + + Action + 11 + Text + 0x1 + + 0xf703-0x220000 + + Action + 10 + Text + [1;2C + + 0xf703-0x240000 + + Action + 10 + Text + [1;5C + + 0xf703-0x260000 + + Action + 10 + Text + [1;6C + + 0xf703-0x280000 + + Action + 10 + Text + f + + 0xf703-0x300000 + + Action + 11 + Text + 0x5 + + 0xf704-0x20000 + + Action + 10 + Text + [1;2P + + 0xf705-0x20000 + + Action + 10 + Text + [1;2Q + + 0xf706-0x20000 + + Action + 10 + Text + [1;2R + + 0xf707-0x20000 + + Action + 10 + Text + [1;2S + + 0xf708-0x20000 + + Action + 10 + Text + [15;2~ + + 0xf709-0x20000 + + Action + 10 + Text + [17;2~ + + 0xf70a-0x20000 + + Action + 10 + Text + [18;2~ + + 0xf70b-0x20000 + + Action + 10 + Text + [19;2~ + + 0xf70c-0x20000 + + Action + 10 + Text + [20;2~ + + 0xf70d-0x20000 + + Action + 10 + Text + [21;2~ + + 0xf70e-0x20000 + + Action + 10 + Text + [23;2~ + + 0xf70f-0x20000 + + Action + 10 + Text + [24;2~ + + 0xf728-0x0 + + Action + 11 + Text + 0x4 + + 0xf728-0x80000 + + Action + 10 + Text + d + + 0xf729-0x20000 + + Action + 10 + Text + [1;2H + + 0xf729-0x40000 + + Action + 10 + Text + [1;5H + + 0xf72b-0x20000 + + Action + 10 + Text + [1;2F + + 0xf72b-0x40000 + + Action + 10 + Text + [1;5F + + 0xf739-0x0 + + Action + 13 + Text + + + + Link Color + + Alpha Component + 1 + Blue Component + 0.73422712087631226 + Color Space + sRGB + Green Component + 0.35915297269821167 + Red Component + 0.0 + + Mouse Reporting + + Name + Default + Non Ascii Font + Monaco 12 + Non-ASCII Anti Aliased + + Normal Font + FiraCodeNerdFontComplete-Regular 16 + Option Key Sends + 2 + Prompt Before Closing 2 + + Right Option Key Sends + 0 + Rows + 25 + Screen + -1 + Scrollback Lines + 1000 + Selected Text Color + + Alpha Component + 1 + Blue Component + 0.0 + Color Space + sRGB + Green Component + 0.0 + Red Component + 0.0 + + Selection Color + + Alpha Component + 1 + Blue Component + 1 + Color Space + sRGB + Green Component + 0.86943882703781128 + Red Component + 0.75743561983108521 + + Send Code When Idle + + Shortcut + + Silence Bell + + Sync Title + + Tags + + Terminal Type + xterm-256color + Thin Strokes + 4 + Transparency + 0.0 + Unlimited Scrollback + + Use Bold Font + + Use Bright Bold + + Use Italic Font + + Use Non-ASCII Font + + Vertical Spacing + 1 + Visual Bell + + Window Type + 0 + Working Directory + /Users/llago + + + PMPrintingExpandedStateForPrint2 + + PMPrintingPanelSize + {777, 1079} + PointerActions + + Button,1,1,, + + Action + kContextMenuPointerAction + + Button,2,1,, + + Action + kPasteFromClipboardPointerAction + + Gesture,ThreeFingerSwipeDown,, + + Action + kPrevWindowPointerAction + + Gesture,ThreeFingerSwipeLeft,, + + Action + kPrevTabPointerAction + + Gesture,ThreeFingerSwipeRight,, + + Action + kNextTabPointerAction + + Gesture,ThreeFingerSwipeUp,, + + Action + kNextWindowPointerAction + + + Print In Black And White + + SoundForEsc + + TabStyleWithAutomaticOption + 5 + TabViewType + 0 + UseBorder + + UseTmuxStatusBar + + VisualIndicatorForEsc + + findMode_iTerm + 0 + + From 902df433be70f5508ad20abffd1153207d8b7b9c Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Fri, 21 Jul 2023 17:51:15 +1000 Subject: [PATCH 24/27] Setup prettier --- Brewfile | 1 + nvim/after/plugin/null-ls.lua | 32 ++++++++++++++++++++++++++++++++ nvim/after/plugin/prettier.lua | 19 +++++++++++++++++++ nvim/lua/llago/packer.lua | 3 +++ 4 files changed, 55 insertions(+) create mode 100644 nvim/after/plugin/null-ls.lua create mode 100644 nvim/after/plugin/prettier.lua diff --git a/Brewfile b/Brewfile index 2ed668e..f5b8f95 100644 --- a/Brewfile +++ b/Brewfile @@ -22,6 +22,7 @@ brew "hashicorp/tap/terraform-ls" brew "tmate" brew "bat" brew "fd" +brew "tree" cask "stats" cask "docker" diff --git a/nvim/after/plugin/null-ls.lua b/nvim/after/plugin/null-ls.lua new file mode 100644 index 0000000..d508fcf --- /dev/null +++ b/nvim/after/plugin/null-ls.lua @@ -0,0 +1,32 @@ +local null_ls = require("null-ls") + +local group = vim.api.nvim_create_augroup("lsp_format_on_save", { clear = false }) +local event = "BufWritePre" -- or "BufWritePost" +local async = event == "BufWritePost" + +null_ls.setup({ + on_attach = function(client, bufnr) + if client.supports_method("textDocument/formatting") then + vim.keymap.set("n", "f", function() + vim.lsp.buf.format({ bufnr = vim.api.nvim_get_current_buf() }) + end, { buffer = bufnr, desc = "[lsp] format" }) + + -- format on save + vim.api.nvim_clear_autocmds({ buffer = bufnr, group = group }) + vim.api.nvim_create_autocmd(event, { + buffer = bufnr, + group = group, + callback = function() + vim.lsp.buf.format({ bufnr = bufnr, async = async }) + end, + desc = "[lsp] format on save", + }) + end + + if client.supports_method("textDocument/rangeFormatting") then + vim.keymap.set("x", "f", function() + vim.lsp.buf.format({ bufnr = vim.api.nvim_get_current_buf() }) + end, { buffer = bufnr, desc = "[lsp] format" }) + end + end, +}) diff --git a/nvim/after/plugin/prettier.lua b/nvim/after/plugin/prettier.lua new file mode 100644 index 0000000..74aacdb --- /dev/null +++ b/nvim/after/plugin/prettier.lua @@ -0,0 +1,19 @@ +local prettier = require("prettier") + +prettier.setup({ + bin = 'prettier', -- or `'prettierd'` (v0.23.3+) + filetypes = { + "css", + "graphql", + "html", + "javascript", + "javascriptreact", + "json", + "less", + "markdown", + "scss", + "typescript", + "typescriptreact", + "yaml", + }, +}) diff --git a/nvim/lua/llago/packer.lua b/nvim/lua/llago/packer.lua index 5d4589c..dcf3ead 100644 --- a/nvim/lua/llago/packer.lua +++ b/nvim/lua/llago/packer.lua @@ -95,6 +95,9 @@ return require('packer').startup(function(use) use { 'github/copilot.vim' } + + use('jose-elias-alvarez/null-ls.nvim') + use('MunifTanjim/prettier.nvim') -- Automatically set up your configuration after cloning packer.nvim -- Put this at the end after all plugins if packer_bootstrap then From a3eb5538096d5828a998050f3c43d2e0230236ba Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Thu, 23 Nov 2023 09:37:15 +1100 Subject: [PATCH 25/27] Add bruno --- Brewfile | 2 ++ macos-bootstrap.sh | 2 +- nvim/after/plugin/colors.lua | 3 ++- nvim/after/plugin/lsp.lua | 6 ++++-- nvim/after/plugin/prettier.lua | 37 ++++++++++++++++++---------------- nvim/lua/llago/packer.lua | 3 ++- 6 files changed, 31 insertions(+), 22 deletions(-) diff --git a/Brewfile b/Brewfile index f5b8f95..fa38fd4 100644 --- a/Brewfile +++ b/Brewfile @@ -23,6 +23,8 @@ brew "tmate" brew "bat" brew "fd" brew "tree" +brew "fsouza/prettierd/prettierd" +brew "bruno" cask "stats" cask "docker" diff --git a/macos-bootstrap.sh b/macos-bootstrap.sh index dfd500a..0f9cfc4 100644 --- a/macos-bootstrap.sh +++ b/macos-bootstrap.sh @@ -37,7 +37,7 @@ ln -sf $(pwd)/zshrc "${HOME}/.zshrc" ln -sf $(pwd)/tmux.conf "${HOME}/.tmux.conf" ln -sf $(pwd)/tmate.conf "${HOME}/.tmate.conf" ln -sf $(pwd)/gitconfig "${HOME}/.gitconfig" -ln -s "$(pwd)/nvim" "${HOME}/.config/nvim" +ln -sf "$(pwd)/nvim" "${HOME}/.config/nvim" mkdir -p "${HOME}/.config/coc/extensions" diff --git a/nvim/after/plugin/colors.lua b/nvim/after/plugin/colors.lua index 615ec2e..3807a83 100644 --- a/nvim/after/plugin/colors.lua +++ b/nvim/after/plugin/colors.lua @@ -1,2 +1,3 @@ vim.o.background = "dark" -- or "light" for light mode -vim.cmd([[colorscheme gruvbox]]) +-- Load the colorscheme +vim.cmd[[colorscheme gruvbox]] diff --git a/nvim/after/plugin/lsp.lua b/nvim/after/plugin/lsp.lua index 51561b1..39566a1 100644 --- a/nvim/after/plugin/lsp.lua +++ b/nvim/after/plugin/lsp.lua @@ -36,8 +36,10 @@ table.insert(cmp_sources, { name = 'nvim_lsp_signature_help' }) -- disable completion with tab -- this helps with copilot setup -cmp_mappings[''] = nil -cmp_mappings[''] = nil +-- cmp_mappings[''] = nil +-- cmp_mappings[''] = nil +vim.g.copilot_no_tab_map = true +vim.api.nvim_set_keymap("i", "", 'copilot#Accept("")', { silent = true, expr = true }) lsp.setup_nvim_cmp({ mapping = cmp_mappings, diff --git a/nvim/after/plugin/prettier.lua b/nvim/after/plugin/prettier.lua index 74aacdb..fbdc6fe 100644 --- a/nvim/after/plugin/prettier.lua +++ b/nvim/after/plugin/prettier.lua @@ -1,19 +1,22 @@ local prettier = require("prettier") -prettier.setup({ - bin = 'prettier', -- or `'prettierd'` (v0.23.3+) - filetypes = { - "css", - "graphql", - "html", - "javascript", - "javascriptreact", - "json", - "less", - "markdown", - "scss", - "typescript", - "typescriptreact", - "yaml", - }, -}) +-- prettier.setup({ +-- bin = 'prettierd', -- or `'prettierd'` (v0.23.3+) +-- filetypes = { +-- "css", +-- "graphql", +-- "html", +-- "javascript", +-- "javascriptreact", +-- "json", +-- "less", +-- "markdown", +-- "scss", +-- "typescript", +-- "typescriptreact", +-- "yaml", +-- }, +-- cli_options = { +-- config_precedence = "prefer-file", +-- }, +-- }) diff --git a/nvim/lua/llago/packer.lua b/nvim/lua/llago/packer.lua index dcf3ead..adb569b 100644 --- a/nvim/lua/llago/packer.lua +++ b/nvim/lua/llago/packer.lua @@ -59,15 +59,16 @@ return require('packer').startup(function(use) { 'saadparwaiz1/cmp_luasnip' }, { 'hrsh7th/cmp-nvim-lsp' }, { 'hrsh7th/cmp-nvim-lua' }, + -- Help signatures for function parameters in insert {'hrsh7th/cmp-nvim-lsp-signature-help'}, -- Snippets { 'L3MON4D3/LuaSnip' }, { 'rafamadriz/friendly-snippets' }, - } } + -- Status line use { 'nvim-lualine/lualine.nvim', From dc90f182760982c29a3c8c58463893b27a6cc43f Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Wed, 20 Mar 2024 17:50:09 -0300 Subject: [PATCH 26/27] Bla --- nvim/after/plugin/lualine.lua | 2 +- nvim/init.lua | 2 +- nvim/lua/llago/packer.lua | 72 ++++++++++++++++++----------------- nvim/lua/llago/set.lua | 2 +- 4 files changed, 40 insertions(+), 38 deletions(-) diff --git a/nvim/after/plugin/lualine.lua b/nvim/after/plugin/lualine.lua index 0be259b..05a5439 100644 --- a/nvim/after/plugin/lualine.lua +++ b/nvim/after/plugin/lualine.lua @@ -1,5 +1,5 @@ require('lualine').setup({ - theme = 'gruvbox', + theme = 'gruvbox_dark', sections = { lualine_c = { 'filename', require('pomodoro').statusline } } diff --git a/nvim/init.lua b/nvim/init.lua index bf928df..c919af4 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -1 +1 @@ -require("./llago") +require("llago") diff --git a/nvim/lua/llago/packer.lua b/nvim/lua/llago/packer.lua index adb569b..12f2359 100644 --- a/nvim/lua/llago/packer.lua +++ b/nvim/lua/llago/packer.lua @@ -9,43 +9,44 @@ local ensure_packer = function() return false end -local packer_bootstrap = ensure_packer() +if vim.g.vscode == nil then + -- File explorer + local packer_bootstrap = ensure_packer() -return require('packer').startup(function(use) - -- Plugin manager - use 'wbthomason/packer.nvim' - -- Fuzzy finder - use { - 'nvim-telescope/telescope.nvim', tag = '0.1.0', - requires = { - { 'nvim-lua/plenary.nvim' }, - { 'nvim-telescope/telescope-fzf-native.nvim', + return require('packer').startup(function(use) + -- Plugin manager + use 'wbthomason/packer.nvim' + -- Fuzzy finder + use { + 'nvim-telescope/telescope.nvim', tag = '0.1.6', + requires = { + { 'nvim-lua/plenary.nvim' }, + { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' } + } } - } - -- Theme - use { "ellisonleao/gruvbox.nvim" } - -- File explorer - use { - 'nvim-tree/nvim-tree.lua', - requires = { - 'nvim-tree/nvim-web-devicons', -- optional, for file icons - }, - } - -- Icons - use('kyazdani42/nvim-web-devicons') - -- Highlighting - use('nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' }) - -- AST debugger - use('nvim-treesitter/playground') - -- File navigation "favorites" - use('ThePrimeagen/harpoon') - -- Undo history - use('mbbill/undotree') - -- Git support - use('tpope/vim-fugitive') - -- LSP - use { 'VonHeikemen/lsp-zero.nvim', + -- Theme + use { "ellisonleao/gruvbox.nvim" } + use { + 'nvim-tree/nvim-tree.lua', + requires = { + 'nvim-tree/nvim-web-devicons', -- optional, for file icons + }, + } + -- Icons + -- use('kyazdani42/nvim-web-devicons') + -- Highlighting + use('nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' }) + -- AST debugger + use('nvim-treesitter/playground') + -- File navigation "favorites" + use('ThePrimeagen/harpoon') + -- Undo history + use('mbbill/undotree') + -- Git support + use('tpope/vim-fugitive') + -- LSP + use { 'VonHeikemen/lsp-zero.nvim', requires = { -- LSP Support { 'neovim/nvim-lspconfig' }, @@ -72,7 +73,7 @@ return require('packer').startup(function(use) -- Status line use { 'nvim-lualine/lualine.nvim', - requires = { 'kyazdani42/nvim-web-devicons', opt = true } + requires = { 'nvim-tree/nvim-web-devicons', opt = true } } -- Language agnostic comments @@ -105,3 +106,4 @@ return require('packer').startup(function(use) require('packer').sync() end end) +end diff --git a/nvim/lua/llago/set.lua b/nvim/lua/llago/set.lua index 7fe5dfa..7d01bc1 100644 --- a/nvim/lua/llago/set.lua +++ b/nvim/lua/llago/set.lua @@ -22,7 +22,7 @@ vim.opt.isfname:append("@-@") vim.opt.updatetime = 50 -- vim.opt.colorcolumn = "120" -vim.opt.clipboard = 'unnamedplus' +vim.opt.clipboard = 'unnamed' vim.opt.cmdheight = 2 vim.opt.hidden = true vim.opt.textwidth = 0 From 28b3a6ec8d9d2b79c2701afbced86def102fe1eb Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Mon, 3 Feb 2025 15:37:15 +1100 Subject: [PATCH 27/27] update dotfiles --- com.googlecode.iterm2.plist | 32 ++++++----- ghostty | 7 +++ gitconfig | 9 +++- macos-bootstrap.sh | 1 + nvim/after/plugin/barbecue.lua | 21 ++++++++ nvim/after/plugin/conform.lua | 18 +++++++ nvim/after/plugin/dap-ui.lua | 1 + nvim/after/plugin/dap.lua | 33 ------------ nvim/after/plugin/harpoon.lua | 12 ++--- nvim/after/plugin/lsp.lua | 2 +- nvim/after/plugin/nvimtree.lua | 10 +++- nvim/init.lua | 7 ++- nvim/lua/llago/autocmd.lua | 9 ++-- nvim/lua/llago/packer.lua | 99 +++++++++++++++++++++------------- zshrc | 21 +++++++- 15 files changed, 183 insertions(+), 99 deletions(-) create mode 100644 ghostty create mode 100644 nvim/after/plugin/barbecue.lua create mode 100644 nvim/after/plugin/conform.lua create mode 100644 nvim/after/plugin/dap-ui.lua diff --git a/com.googlecode.iterm2.plist b/com.googlecode.iterm2.plist index 8ebdfa8..04c5111 100644 --- a/com.googlecode.iterm2.plist +++ b/com.googlecode.iterm2.plist @@ -4,16 +4,6 @@ AllowClipboardAccess - AppleAntiAliasingThreshold - 1 - ApplePressAndHoldEnabled - - AppleScrollAnimationEnabled - 0 - AppleSmoothFixedFontsSizeThreshold - 1 - AppleWindowTabbingMode - manual Custom Color Presets Gruvbox Dark @@ -177,10 +167,16 @@ E756D64B-FFAE-4ACF-9AA9-FC2ACB21AD39 DisableFullscreenTransparency + FlashTabBarInFullscreen + + HTMLTabTitles + HapticFeedbackForEsc HideScrollbar + HideTab + HotkeyMigratedFromSingleToMulti New Bookmarks @@ -188,6 +184,8 @@ ASCII Anti Aliased + ASCII Ligatures + Ambiguous Double Width Ansi 0 Color @@ -339,7 +337,7 @@ 0.98431372549019602 BM Growl - + Background Color Blue Component @@ -438,6 +436,8 @@ Default Disable Window Resizing + Draw Powerline Glyphs + Flashing Bell Foreground Color @@ -914,7 +914,7 @@ Non-ASCII Anti Aliased Normal Font - FiraCodeNerdFontComplete-Regular 16 + FiraCodeNF-Ret 16 Option Key Sends 2 Prompt Before Closing 2 @@ -982,7 +982,7 @@ Vertical Spacing 1 Visual Bell - + Window Type 0 Working Directory @@ -1026,10 +1026,16 @@ kNextWindowPointerAction + PreserveWindowSizeWhenTabBarVisibilityChanges + Print In Black And White + SavePasteHistory + SoundForEsc + SplitPaneDimmingAmount + 0.40073649878640771 TabStyleWithAutomaticOption 5 TabViewType diff --git a/ghostty b/ghostty new file mode 100644 index 0000000..df29c4d --- /dev/null +++ b/ghostty @@ -0,0 +1,7 @@ +theme = "GruvboxDark" +font-family = "FiraCode Nerd Font" +font-size = 16 +font-feature = -liga +font-feature = -calt +font-feature = -dlig +selection-invert-fg-bg = true diff --git a/gitconfig b/gitconfig index a66d3d7..99477c1 100644 --- a/gitconfig +++ b/gitconfig @@ -16,7 +16,14 @@ [init] defaultBranch = main [filter "lfs"] - required = true clean = git-lfs clean -- %f smudge = git-lfs smudge -- %f process = git-lfs filter-process + required = true +[trace2] + eventTarget = af_unix:/Users/llago/atlassian/.canvas/telemetry/git-tracing.sock + eventBrief = true + eventNesting = 1 + configparams = custom.metacommands +[maintenance] + repo = /Users/llago/Development/atlassian/atlassian-frontend-monorepo diff --git a/macos-bootstrap.sh b/macos-bootstrap.sh index 0f9cfc4..44f958d 100644 --- a/macos-bootstrap.sh +++ b/macos-bootstrap.sh @@ -38,6 +38,7 @@ ln -sf $(pwd)/tmux.conf "${HOME}/.tmux.conf" ln -sf $(pwd)/tmate.conf "${HOME}/.tmate.conf" ln -sf $(pwd)/gitconfig "${HOME}/.gitconfig" ln -sf "$(pwd)/nvim" "${HOME}/.config/nvim" +ln -sf $(pwd)/ghostty "${HOME}/Library/Application Support/com.mitchellh.ghostty/config" mkdir -p "${HOME}/.config/coc/extensions" diff --git a/nvim/after/plugin/barbecue.lua b/nvim/after/plugin/barbecue.lua new file mode 100644 index 0000000..2648b9d --- /dev/null +++ b/nvim/after/plugin/barbecue.lua @@ -0,0 +1,21 @@ +-- triggers CursorHold event faster +vim.opt.updatetime = 200 + +require("barbecue").setup({ + create_autocmd = false, -- prevent barbecue from updating itself automatically +}) + +vim.api.nvim_create_autocmd({ + "WinScrolled", -- or WinResized on NVIM-v0.9 and higher + "BufWinEnter", + "CursorHold", + "InsertLeave", + + -- include this if you have set `show_modified` to `true` + "BufModifiedSet", +}, { + group = vim.api.nvim_create_augroup("barbecue.updater", {}), + callback = function() + require("barbecue.ui").update() + end, +}) diff --git a/nvim/after/plugin/conform.lua b/nvim/after/plugin/conform.lua new file mode 100644 index 0000000..eb96c9d --- /dev/null +++ b/nvim/after/plugin/conform.lua @@ -0,0 +1,18 @@ +require("conform").setup({ + formatters_by_ft = { + lua = { "stylua" }, + -- Conform will run multiple formatters sequentially + python = { "isort", "black" }, + -- You can customize some of the format options for the filetype (:help conform.format) + rust = { "rustfmt", lsp_format = "fallback" }, + javascript = { "prettierd", stop_after_first = false }, + typescript = { "prettierd", stop_after_first = false }, + typescriptreact = { "prettierd", stop_after_first = false }, + javascriptreact = { "prettierd", stop_after_first = false }, + }, + format_on_save = { + -- These options will be passed to conform.format() + timeout_ms = 500, + lsp_format = "fallback", + }, +}) diff --git a/nvim/after/plugin/dap-ui.lua b/nvim/after/plugin/dap-ui.lua new file mode 100644 index 0000000..648a3e8 --- /dev/null +++ b/nvim/after/plugin/dap-ui.lua @@ -0,0 +1 @@ +require("dapui").setup() diff --git a/nvim/after/plugin/dap.lua b/nvim/after/plugin/dap.lua index 708ecf1..e69de29 100644 --- a/nvim/after/plugin/dap.lua +++ b/nvim/after/plugin/dap.lua @@ -1,33 +0,0 @@ --- local dap = require('dap') - --- dap.adapters.chrome = { --- type = "executable", --- command = "node", --- args = {os.getenv("HOME") .. "/path/to/vscode-chrome-debug/out/src/chromeDebug.js"} -- TODO adjust --- } - --- dap.configurations.javascriptreact = { -- change this to javascript if needed --- { --- type = "chrome", --- request = "attach", --- program = "${file}", --- cwd = vim.fn.getcwd(), --- sourceMaps = true, --- protocol = "inspector", --- port = 9222, --- webRoot = "${workspaceFolder}" --- } --- } - --- dap.configurations.typescriptreact = { -- change to typescript if needed --- { --- type = "chrome", --- request = "attach", --- program = "${file}", --- cwd = vim.fn.getcwd(), --- sourceMaps = true, --- protocol = "inspector", --- port = 9222, --- webRoot = "${workspaceFolder}" --- } --- } diff --git a/nvim/after/plugin/harpoon.lua b/nvim/after/plugin/harpoon.lua index 9bfa3ef..915ca30 100644 --- a/nvim/after/plugin/harpoon.lua +++ b/nvim/after/plugin/harpoon.lua @@ -1,10 +1,10 @@ local mark = require('harpoon.mark') local ui = require('harpoon.ui') -vim.keymap.set('n', 'a', mark.add_file) -vim.keymap.set('n', '', ui.toggle_quick_menu) +-- vim.keymap.set('n', 'a', mark.add_file) +-- vim.keymap.set('n', '', ui.toggle_quick_menu) -vim.keymap.set('n', '', function () ui.nav_file(1) end) -vim.keymap.set('n', '', function () ui.nav_file(2) end) -vim.keymap.set('n', '', function () ui.nav_file(3) end) -vim.keymap.set('n', '', function () ui.nav_file(4) end) +-- vim.keymap.set('n', '', function () ui.nav_file(1) end) +-- vim.keymap.set('n', '', function () ui.nav_file(2) end) +-- vim.keymap.set('n', '', function () ui.nav_file(3) end) +-- vim.keymap.set('n', '', function () ui.nav_file(4) end) diff --git a/nvim/after/plugin/lsp.lua b/nvim/after/plugin/lsp.lua index 39566a1..04b1610 100644 --- a/nvim/after/plugin/lsp.lua +++ b/nvim/after/plugin/lsp.lua @@ -4,7 +4,7 @@ lsp.preset("recommended") lsp.ensure_installed({ 'html', - 'tsserver', + 'ts_ls', 'eslint', 'lua_ls', 'rust_analyzer', diff --git a/nvim/after/plugin/nvimtree.lua b/nvim/after/plugin/nvimtree.lua index 58e685a..3e2fe62 100644 --- a/nvim/after/plugin/nvimtree.lua +++ b/nvim/after/plugin/nvimtree.lua @@ -2,8 +2,16 @@ vim.g.loaded_netrw = 1 vim.g.loaded_netrwPlugin = 1 +-- 24 bit colors +vim.opt.termguicolors = true + vim.keymap.set("n", "", vim.cmd.NvimTreeToggle) vim.keymap.set("n", "r", vim.cmd.NvimTreeRefresh) vim.keymap.set("n", "n", vim.cmd.NvimTreeFindFile) -require("nvim-tree").setup() +require("nvim-tree").setup({ + view = { + width = 100, + side = "left", + } +}) diff --git a/nvim/init.lua b/nvim/init.lua index c919af4..ae4f036 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -1 +1,6 @@ -require("llago") +if vim.g.vscode then + -- VSCode Neovim specific stuff +else + require("llago") +end + diff --git a/nvim/lua/llago/autocmd.lua b/nvim/lua/llago/autocmd.lua index 221c44d..e1d4d6f 100644 --- a/nvim/lua/llago/autocmd.lua +++ b/nvim/lua/llago/autocmd.lua @@ -1,5 +1,6 @@ -vim.api.nvim_create_autocmd('BufWritePre', { - pattern = { '*.tsx', '*.ts', '*.jsx', '*.js' }, - command = 'silent! EslintFixAll', - group = vim.api.nvim_create_augroup('MyAutocmdsJavaScripFormatting', {}), +vim.api.nvim_create_autocmd("BufWritePre", { + pattern = "*", + callback = function(args) + require("conform").format({ bufnr = args.buf, lsp_fallback = true }) + end, }) diff --git a/nvim/lua/llago/packer.lua b/nvim/lua/llago/packer.lua index 12f2359..fbce0b1 100644 --- a/nvim/lua/llago/packer.lua +++ b/nvim/lua/llago/packer.lua @@ -9,44 +9,43 @@ local ensure_packer = function() return false end -if vim.g.vscode == nil then - -- File explorer - local packer_bootstrap = ensure_packer() - - return require('packer').startup(function(use) - -- Plugin manager - use 'wbthomason/packer.nvim' - -- Fuzzy finder - use { - 'nvim-telescope/telescope.nvim', tag = '0.1.6', - requires = { - { 'nvim-lua/plenary.nvim' }, - { 'nvim-telescope/telescope-fzf-native.nvim', +-- File explorer +local packer_bootstrap = ensure_packer() + +return require('packer').startup(function(use) + -- Plugin manager + use 'wbthomason/packer.nvim' + -- Fuzzy finder + use { + 'nvim-telescope/telescope.nvim', tag = '0.1.6', + requires = { + { 'nvim-lua/plenary.nvim' }, + { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' } - } - } - -- Theme - use { "ellisonleao/gruvbox.nvim" } - use { - 'nvim-tree/nvim-tree.lua', - requires = { - 'nvim-tree/nvim-web-devicons', -- optional, for file icons - }, } - -- Icons - -- use('kyazdani42/nvim-web-devicons') - -- Highlighting - use('nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' }) - -- AST debugger - use('nvim-treesitter/playground') - -- File navigation "favorites" - use('ThePrimeagen/harpoon') - -- Undo history - use('mbbill/undotree') - -- Git support - use('tpope/vim-fugitive') - -- LSP - use { 'VonHeikemen/lsp-zero.nvim', + } + -- Theme + use { "ellisonleao/gruvbox.nvim" } + use { + 'nvim-tree/nvim-tree.lua', + requires = { + 'nvim-tree/nvim-web-devicons', -- optional, for file icons + }, + } + -- Icons + -- use('kyazdani42/nvim-web-devicons') + -- Highlighting + use('nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' }) + -- AST debugger + use('nvim-treesitter/playground') + -- File navigation "favorites" + use('ThePrimeagen/harpoon') + -- Undo history + use('mbbill/undotree') + -- Git support + use('tpope/vim-fugitive') + -- LSP + use { 'VonHeikemen/lsp-zero.nvim', requires = { -- LSP Support { 'neovim/nvim-lspconfig' }, @@ -62,7 +61,7 @@ if vim.g.vscode == nil then { 'hrsh7th/cmp-nvim-lua' }, -- Help signatures for function parameters in insert - {'hrsh7th/cmp-nvim-lsp-signature-help'}, + { 'hrsh7th/cmp-nvim-lsp-signature-help' }, -- Snippets { 'L3MON4D3/LuaSnip' }, @@ -100,10 +99,34 @@ if vim.g.vscode == nil then use('jose-elias-alvarez/null-ls.nvim') use('MunifTanjim/prettier.nvim') + use { "rcarriga/nvim-dap-ui", requires = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" } } + + -- yarn pnp support https://yarnpkg.com/getting-started/editor-sdks + use('lbrayner/vim-rzip') -- Automatically set up your configuration after cloning packer.nvim -- Put this at the end after all plugins + + -- Formatter + use({ + "stevearc/conform.nvim", + config = function() + require("conform").setup() + end, + }) + + use({ + "utilyre/barbecue.nvim", + tag = "*", + requires = { + "SmiteshP/nvim-navic", + "nvim-tree/nvim-web-devicons", -- optional dependency + }, + after = "nvim-web-devicons", -- keep this if you're using NvChad + config = function() + require("barbecue").setup() + end, + }) if packer_bootstrap then require('packer').sync() end end) -end diff --git a/zshrc b/zshrc index 86d9876..2f5677d 100644 --- a/zshrc +++ b/zshrc @@ -11,6 +11,7 @@ export PATH=~/.cargo/bin:$PATH # to know which specific one was loaded, run: echo $RANDOM_THEME # See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes ZSH_THEME="robbyrussell" +ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=11' # Set list of themes to pick from when loading at random # Setting this variable when ZSH_THEME=random will cause zsh to load @@ -65,7 +66,7 @@ ZSH_THEME="robbyrussell" # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. plugins=( - npm yarn git zsh-autosuggestions docker docker-compose docker-machine fzf node heroku aws gem zsh-syntax-highlighting tmux + npm yarn git zsh-autosuggestions docker docker-compose fzf node heroku aws gem zsh-syntax-highlighting tmux ) source $ZSH/oh-my-zsh.sh @@ -116,3 +117,21 @@ function change-mac() { . /usr/local/bin/z.sh eval "$(fnm env)" + +source ~/.afm-git-configrc + +export PATH="/Users/llago/.local/bin:$PATH" + +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion + +# Load pyenv automatically by appending +# the following to +# ~/.zprofile (for login shells) +# and ~/.zshrc (for interactive shells) : + +export PYENV_ROOT="$HOME/.pyenv" +[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH" +eval "$(pyenv init - zsh)" +