diff options
Diffstat (limited to 'lua/user')
| -rw-r--r-- | lua/user/autocommands.lua | 75 | ||||
| -rw-r--r-- | lua/user/plugins.lua | 110 |
2 files changed, 62 insertions, 123 deletions
diff --git a/lua/user/autocommands.lua b/lua/user/autocommands.lua index 94d861b..49cce6f 100644 --- a/lua/user/autocommands.lua +++ b/lua/user/autocommands.lua @@ -1,23 +1,18 @@ --- vim.api.nvim_create_autocmd({ "User" }, { --- pattern = { "AlphaReady" }, --- callback = function() --- vim.cmd [[ --- set showtabline=0 | autocmd BufUnload <buffer> set showtabline=2 --- ]] --- end, --- }) - +-- Remove statusline and tabline when in Alpha vim.api.nvim_create_autocmd({ "User" }, { pattern = { "AlphaReady" }, callback = function() vim.cmd [[ + set showtabline=0 | autocmd BufUnload <buffer> set showtabline=2 set laststatus=0 | autocmd BufUnload <buffer> set laststatus=3 ]] end, }) + +-- use q to quit when in common plugins vim.api.nvim_create_autocmd({ "FileType" }, { - pattern = { "Jaq", "qf", "help", "man", "lspinfo", "spectre_panel", "lir", "DressingSelect", "tsplayground" }, + pattern = { "help", "man", "lspinfo" }, callback = function() vim.cmd [[ nnoremap <silent> <buffer> q :close<CR> @@ -26,16 +21,6 @@ vim.api.nvim_create_autocmd({ "FileType" }, { end, }) -vim.api.nvim_create_autocmd({ "FileType" }, { - pattern = { "Jaq" }, - callback = function() - vim.cmd [[ - nnoremap <silent> <buffer> <m-r> :close<CR> - " nnoremap <silent> <buffer> <m-r> <NOP> - set nobuflisted - ]] - end, -}) vim.api.nvim_create_autocmd({ "BufEnter" }, { pattern = { "" }, @@ -56,11 +41,11 @@ vim.api.nvim_create_autocmd({ "BufEnter" }, { pattern = { "term://*" }, callback = function() vim.cmd "startinsert!" - -- TODO: if java = 2 vim.cmd "set cmdheight=1" end, }) +-- Set spell and wrap in markdown and gitcommit vim.api.nvim_create_autocmd({ "FileType" }, { pattern = { "gitcommit", "markdown" }, callback = function() @@ -69,22 +54,7 @@ vim.api.nvim_create_autocmd({ "FileType" }, { end, }) -vim.api.nvim_create_autocmd({ "FileType" }, { - pattern = { "lir" }, - callback = function() - vim.opt_local.number = false - vim.opt_local.relativenumber = false - end, -}) - vim.cmd "autocmd BufEnter * ++nested if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif" --- vim.api.nvim_create_autocmd({ "BufEnter" }, { --- callback = function() --- vim.cmd [[ --- if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif --- ]] --- end, --- }) vim.api.nvim_create_autocmd({ "VimResized" }, { callback = function() @@ -98,39 +68,21 @@ vim.api.nvim_create_autocmd({ "CmdWinEnter" }, { end, }) --- require("user.winbar").get_winbar() - -if vim.fn.has "nvim-0.8" == 1 then - vim.api.nvim_create_autocmd( - { "CursorMoved", "CursorHold", "BufWinEnter", "BufFilePost", "InsertEnter", "BufWritePost", "TabClosed" }, - { - callback = function() - require("user.winbar").get_winbar() - end, - } - ) -end --- require "user.winbar" +-- fixes Autocomment vim.api.nvim_create_autocmd({ "BufWinEnter" }, { callback = function() vim.cmd "set formatoptions-=cro" end, }) +-- Highlight yanked text vim.api.nvim_create_autocmd({ "TextYankPost" }, { callback = function() vim.highlight.on_yank { higroup = "Visual", timeout = 200 } end, }) -vim.api.nvim_create_autocmd({ "BufWritePost" }, { - pattern = { "*.java" }, - callback = function() - vim.lsp.codelens.refresh() - end, -}) - vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = function() vim.cmd "hi link illuminatedWord LspReferenceText" @@ -143,14 +95,3 @@ vim.api.nvim_create_autocmd({ "BufWinEnter" }, { vim.cmd "checktime" end, }) - --- vim.api.nvim_create_autocmd({ "ModeChanged" }, { --- callback = function() --- local luasnip = require "luasnip" --- if luasnip.expand_or_jumpable() then --- -- ask maintainer for option to make this silent --- -- luasnip.unlink_current() --- vim.cmd [[silent! lua require("luasnip").unlink_current()]] --- end --- end, --- }) diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua index 40adaaf..f637bd1 100644 --- a/lua/user/plugins.lua +++ b/lua/user/plugins.lua @@ -41,82 +41,80 @@ packer.init { -- Install your plugins here return packer.startup(function(use) -- My plugins here - use "wbthomason/packer.nvim" -- Have packer manage itself - use "nvim-lua/popup.nvim" -- An implementation of the Popup API from vim in Neovim - use "nvim-lua/plenary.nvim" -- Useful lua functions used ny lots of plugins - use "akinsho/toggleterm.nvim" - use "akinsho/bufferline.nvim" - use "antoinemadec/FixCursorHold.nvim" -- This is needed to fix lsp doc highlight - use "folke/which-key.nvim" - use 'kyazdani42/nvim-web-devicons' - use 'kyazdani42/nvim-tree.lua' - use "lewis6991/impatient.nvim" - use "lukas-reineke/indent-blankline.nvim" - use "moll/vim-bbye" - use "numToStr/Comment.nvim" -- Easily comment stuff - use "nvim-lualine/lualine.nvim" - use "windwp/nvim-autopairs" -- Autopairs, integrates with both cmp and treesitter - use "vimwiki/vimwiki" - use "zane-/howdoi.nvim" - -- use "gleitz/howdoi.nvim" - -- - -- Colorschemes - use "lunarvim/colorschemes" -- A bunch of colorschemes you can try out - use "lunarvim/darkplus.nvim" - use 'tiagovla/tokyodark.nvim' + use {"wbthomason/packer.nvim", commit = ""} -- Have packer manage itself + use {"nvim-lua/popup.nvim", commit = ""} -- An implementation of the Popup API from vim in Neovim + use {"nvim-lua/plenary.nvim", commit = ""} -- Useful lua functions used ny lots of plugins + use {"akinsho/toggleterm.nvim", commit = ""} + use {"akinsho/bufferline.nvim", commit = ""} + use {"antoinemadec/FixCursorHold.nvim", commit = ""} -- This is needed to fix lsp doc highlight + use {"folke/which-key.nvim", commit = ""} + use {"kyazdani42/nvim-web-devicons", commit = ""} + use {"kyazdani42/nvim-tree.lua", commit = ""} + use {"lewis6991/impatient.nvim", commit = ""} + use {"lukas-reineke/indent-blankline.nvim", commit = ""} + use {"moll/vim-bbye", commit = ""} + use {"numToStr/Comment.nvim", commit = ""} -- Easily comment stuff + use {"nvim-lualine/lualine.nvim", commit = ""} + use {"windwp/nvim-autopairs", commit = ""} -- Autopairs, integrates with both cmp and treesitter + use {"vimwiki/vimwiki", commit = ""} + use {"zane-/howdoi.nvim", commit = ""} + -- Colorschemes + use {"lunarvim/colorschemes", commit = ""} -- A bunch of colorschemes you can try out + use {"lunarvim/darkplus.nvim", commit = ""} + use {"tiagovla/tokyodark.nvim", commit = ""} -- cmp plugins - use "hrsh7th/nvim-cmp" -- The completion plugin - use "hrsh7th/cmp-buffer" -- buffer completions - use "hrsh7th/cmp-path" -- path completions - use "hrsh7th/cmp-cmdline" -- cmdline completions - use "hrsh7th/cmp-nvim-lsp" - use "hrsh7th/cmp-nvim-lua" - use "saadparwaiz1/cmp_luasnip" -- snippet completions + use {"hrsh7th/nvim-cmp", commit = ""} -- The completion plugin + use {"hrsh7th/cmp-buffer", commit = ""} -- buffer completions + use {"hrsh7th/cmp-path", commit = ""} -- path completions + use {"hrsh7th/cmp-cmdline", commit = ""} -- cmdline completions + use {"hrsh7th/cmp-nvim-lsp", commit = ""} + use {"hrsh7th/cmp-nvim-lua", commit = ""} + use {"saadparwaiz1/cmp_luasnip", commit = ""} -- snippet completions -- snippets - use "L3MON4D3/LuaSnip" --snippet engine - use "rafamadriz/friendly-snippets" -- a bunch of snippets to use + use {"L3MON4D3/LuaSnip", commit = ""} --snippet engine + use {"rafamadriz/friendly-snippets", commit = ""} -- a bunch of snippets to use -- LSP - use "jose-elias-alvarez/null-ls.nvim" -- for formatters and linters - use "tamago324/nlsp-settings.nvim" -- language server settings defined in json for - use "neovim/nvim-lspconfig" -- enable LSP - use "williamboman/nvim-lsp-installer" -- simple to use language server installer - use "RRethy/vim-illuminate" + use {"jose-elias-alvarez/null-ls.nvim", commit = ""} -- for formatters and linters + use {"tamago324/nlsp-settings.nvim", commit = ""} -- language server settings defined in json for + use {"neovim/nvim-lspconfig", commit = ""} -- enable LSP + use {"williamboman/nvim-lsp-installer", commit = ""} -- simple to use language server installer + use {"RRethy/vim-illuminate", commit = ""} -- Telescope - use "nvim-telescope/telescope.nvim" - use 'nvim-telescope/telescope-media-files.nvim' + use {"nvim-telescope/telescope.nvim", commit = ""} + use {"nvim-telescope/telescope-media-files.nvim", commit = ""} -- Treesitter use { - "nvim-treesitter/nvim-treesitter", + "nvim-treesitter/nvim-treesitter", commit = "", run = ":TSUpdate", } - use "JoosepAlviste/nvim-ts-context-commentstring" - use "windwp/nvim-ts-autotag" - use "romgrk/nvim-treesitter-context" + use {"JoosepAlviste/nvim-ts-context-commentstring", commit = ""} + use {"windwp/nvim-ts-autotag", commit = ""} + use {"romgrk/nvim-treesitter-context", commit = ""} -- Git - use "lewis6991/gitsigns.nvim" - use "p00f/nvim-ts-rainbow" - use "nvim-treesitter/playground" + use {"lewis6991/gitsigns.nvim", commit = ""} + use {"p00f/nvim-ts-rainbow", commit = ""} + use {"nvim-treesitter/playground", commit = ""} -- DAP - use "mfussenegger/nvim-dap" - use "mfussenegger/nvim-dap-python" - use "rcarriga/nvim-dap-ui" - use "Pocco81/DAPInstall.nvim" + use {"mfussenegger/nvim-dap", commit = ""} + use {"mfussenegger/nvim-dap-python", commit = ""} + use {"rcarriga/nvim-dap-ui", commit = ""} + use {"Pocco81/DAPInstall.nvim", commit = ""} -- Jupyter interaction - use 'hkupty/iron.nvim' - use 'kana/vim-textobj-user' - use 'kana/vim-textobj-line' - use 'GCBallesteros/vim-textobj-hydrogen' - use 'GCBallesteros/jupytext.vim' - use { 'dccsillag/magma-nvim', run = ':UpdateRemotePlugins' } + use {"hkupty/iron.nvim", commit = ""} + use {"kana/vim-textobj-user", commit = ""} + use {"kana/vim-textobj-line", commit = ""} + use {"GCBallesteros/vim-textobj-hydrogen", commit = ""} + use {"GCBallesteros/jupytext.vim", commit = ""} + use {"dccsillag/magma-nvim", commit = "", run = ":UpdateRemotePlugins" } |
