From 22c59a447f410f9fb63822262ff698bddf2f3b04 Mon Sep 17 00:00:00 2001 From: frosty Date: Mon, 29 Jul 2024 04:01:49 -0400 Subject: [PATCH] regular update dunno --- init.lua | 2 -- lua/frosty/autocmds.lua | 38 ++++++++++++++++--------------- lua/frosty/keymaps.lua | 5 ++++ lua/frosty/options.lua | 5 ++-- lua/frosty/plugins/lspconfig.lua | 12 ++++++++-- lua/frosty/plugins/lualine.lua | 1 - lua/frosty/plugins/neogit.lua | 1 + lua/frosty/plugins/telescope.lua | 32 +++++++++++++++++--------- lua/frosty/plugins/treesitter.lua | 2 +- 9 files changed, 61 insertions(+), 37 deletions(-) diff --git a/init.lua b/init.lua index 0e4285b..a734729 100644 --- a/init.lua +++ b/init.lua @@ -1,9 +1,7 @@ --- Call other files require('frosty.options') require('frosty.keymaps') require('frosty.autocmds') --- Initialize Lazy local lazy_path = vim.fn.stdpath('data') .. '/lazy/lazy.nvim' if not (vim.uv or vim.loop).fs_stat(lazy_path) then vim.fn.system({ diff --git a/lua/frosty/autocmds.lua b/lua/frosty/autocmds.lua index 89aefdb..57e6a55 100644 --- a/lua/frosty/autocmds.lua +++ b/lua/frosty/autocmds.lua @@ -1,29 +1,31 @@ vim.api.nvim_create_autocmd('TextYankPost', { - callback = function() - vim.highlight.on_yank({ higroup = 'IncSearch', timeout = 250 }) - end + callback = function() + vim.highlight.on_yank({ higroup = 'IncSearch', timeout = 250 }) + end }) vim.api.nvim_create_autocmd('BufWritePre', { - callback = function() - vim.lsp.buf.format() - end + callback = function() + vim.lsp.buf.format() + end }) vim.api.nvim_create_autocmd('FileType', { - pattern = { 'lua' }, - callback = function() - vim.o.shiftwidth = 2 - vim.o.softtabstop = 2 - vim.o.tabstop = 2 - end + pattern = { 'lua' }, + callback = function() + vim.o.shiftwidth = 2 + vim.o.softtabstop = 2 + vim.o.tabstop = 2 + vim.o.expandtab = true + end }) vim.api.nvim_create_autocmd('FileType', { - pattern = { 'sh', 'zsh' }, - callback = function() - vim.o.shiftwidth = 4 - vim.o.softtabstop = 4 - vim.o.tabstop = 4 - end + pattern = { 'sh', 'zsh' }, + callback = function() + vim.o.shiftwidth = 4 + vim.o.softtabstop = 4 + vim.o.tabstop = 4 + vim.o.expandtab = true + end }) diff --git a/lua/frosty/keymaps.lua b/lua/frosty/keymaps.lua index 4a9df64..7a0d580 100644 --- a/lua/frosty/keymaps.lua +++ b/lua/frosty/keymaps.lua @@ -35,4 +35,9 @@ vim.keymap.set('n', 'l', ':Lazy') vim.keymap.set('n', 'gg', ':Neogit') vim.keymap.set('n', 'gc', ':Neogit commit') +-- Alpha vim.keymap.set('n', 'h', ':Alpha') + +-- Visual block selection movement +vim.keymap.set('v', 'J', ":m '>+1gv=gv", { noremap = true }) +vim.keymap.set('v', 'K', ":m '<-2gv=gv", { noremap = true }) diff --git a/lua/frosty/options.lua b/lua/frosty/options.lua index 06a7865..9188286 100644 --- a/lua/frosty/options.lua +++ b/lua/frosty/options.lua @@ -2,5 +2,6 @@ vim.o.number = true vim.o.relativenumber = true vim.o.cursorline = true vim.o.termguicolors = true -vim.opt.showmode = false -vim.opt.clipboard = 'unnamedplus' +vim.o.showmode = false +vim.o.clipboard = 'unnamedplus' +vim.o.swapfile = false diff --git a/lua/frosty/plugins/lspconfig.lua b/lua/frosty/plugins/lspconfig.lua index ea80d7e..4d438e8 100644 --- a/lua/frosty/plugins/lspconfig.lua +++ b/lua/frosty/plugins/lspconfig.lua @@ -1,7 +1,12 @@ return { 'neovim/nvim-lspconfig', - dependencies = { 'hrsh7th/cmp-nvim-lsp' }, + dependencies = { 'hrsh7th/cmp-nvim-lsp', 'williamboman/mason.nvim', 'williamboman/mason-lspconfig.nvim' }, config = function() + require('mason').setup() + require('mason-lspconfig').setup({ + ensure_installed = { 'lua_ls', 'rust_analyzer', 'bashls', 'gopls' } + }) + local lspconfig = require('lspconfig') local capabilities = require('cmp_nvim_lsp').default_capabilities() @@ -20,7 +25,10 @@ return { } }) lspconfig['rust_analyzer'].setup({ - capabilities = capabilities, + capabilities = capabilities + }) + lspconfig['gopls'].setup({ + capabilities = capabilities }) lspconfig['bashls'].setup({ capabilities = capabilities, diff --git a/lua/frosty/plugins/lualine.lua b/lua/frosty/plugins/lualine.lua index 11a6e36..bd242b8 100644 --- a/lua/frosty/plugins/lualine.lua +++ b/lua/frosty/plugins/lualine.lua @@ -1,6 +1,5 @@ return { 'nvim-lualine/lualine.nvim', - dependencies = { 'nvim-tree/nvim-web-devicons', 'archibate/lualine-time' }, opts = { options = { icons_enabled = false, diff --git a/lua/frosty/plugins/neogit.lua b/lua/frosty/plugins/neogit.lua index a1e4279..d8c2852 100644 --- a/lua/frosty/plugins/neogit.lua +++ b/lua/frosty/plugins/neogit.lua @@ -1,5 +1,6 @@ return { 'NeogitOrg/neogit', + tag = 'v0.0.1', dependencies = { 'nvim-lua/plenary.nvim', 'sindrets/diffview.nvim', 'nvim-telescope/telescope.nvim' }, config = true } diff --git a/lua/frosty/plugins/telescope.lua b/lua/frosty/plugins/telescope.lua index f2b7e54..1f9195b 100644 --- a/lua/frosty/plugins/telescope.lua +++ b/lua/frosty/plugins/telescope.lua @@ -1,17 +1,27 @@ return { 'nvim-telescope/telescope.nvim', dependencies = { 'nvim-lua/plenary.nvim' }, - opts = { - pickers = { - find_files = { - find_command = { 'rg', '--files', '--hidden', '-g', '!.git' } + config = function() + local actions = require('telescope.actions') + + require('telescope').setup({ + defaults = { + mappings = { + n = { + ['q'] = actions.close + } + } }, - buffers = { - show_all_buffers = true - }, - mappings = { - n = { ['q'] = require('telescope.actions').close }, + pickers = { + find_files = { + disable_devicons = true, + find_command = { 'rg', '--files', '--hidden' } + }, + buffers = { + disable_devicons = true, + show_all_buffers = true + } } - } - } + }) + end } diff --git a/lua/frosty/plugins/treesitter.lua b/lua/frosty/plugins/treesitter.lua index b45878c..7c8743f 100644 --- a/lua/frosty/plugins/treesitter.lua +++ b/lua/frosty/plugins/treesitter.lua @@ -2,7 +2,7 @@ return { 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', opts = { - ensure_installed = { 'c', 'lua', 'vim', 'yaml', 'toml', 'markdown', 'vimdoc', 'bash', 'html', 'python', 'haskell', 'rust' }, + ensure_installed = { 'c', 'lua', 'vim', 'yaml', 'toml', 'markdown', 'vimdoc', 'bash', 'html', 'python', 'haskell', 'rust', 'go' }, sync_install = false, highlight = { enable = true }, indent = { enable = true }