summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorseth <[email protected]>2023-09-06 10:36:50 -0400
committerseth <[email protected]>2023-09-06 10:48:17 -0400
commitf528bd1b1435fef8185c106b4f1e17d64dd5bf2d (patch)
treeddfd5851481c492b56bcfab66479e8d6cd0ef5a1 /lua
parent4f2a2d2b13a1c0bfe2a9234679b9a0b9d1e4b83f (diff)
big update woo
Diffstat (limited to 'lua')
-rw-r--r--lua/getchoo/filetypes.lua8
-rw-r--r--lua/getchoo/init.lua9
-rw-r--r--lua/getchoo/keybinds.lua17
-rw-r--r--lua/getchoo/plugins/general.lua75
-rw-r--r--lua/getchoo/plugins/init.lua5
-rw-r--r--lua/getchoo/plugins/lazy.lua41
-rw-r--r--lua/getchoo/plugins/lsp.lua22
-rw-r--r--lua/getchoo/plugins/ui.lua40
8 files changed, 170 insertions, 47 deletions
diff --git a/lua/getchoo/filetypes.lua b/lua/getchoo/filetypes.lua
deleted file mode 100644
index cb62635..0000000
--- a/lua/getchoo/filetypes.lua
+++ /dev/null
@@ -1,8 +0,0 @@
-local filetypes = {
- filename = {
- PKGBUILD = "text",
- [".makepkg.conf"] = "text",
- },
-}
-
-vim.filetype.add(filetypes)
diff --git a/lua/getchoo/init.lua b/lua/getchoo/init.lua
index 94a02dc..461d217 100644
--- a/lua/getchoo/init.lua
+++ b/lua/getchoo/init.lua
@@ -6,7 +6,8 @@ opt.tabstop = 2
opt.shiftwidth = 2
opt.expandtab = false
opt.smartindent = true
-opt.wrap = false
+opt.wrap = true
+opt.relativenumer = true
-- appearance
opt.syntax = "on"
@@ -14,8 +15,4 @@ cmd("filetype plugin indent on")
opt.termguicolors = true
require("getchoo.keybinds")
-require("getchoo.filetypes")
-
-if vim.g.no_plugins then
- require("getchoo.plugins")
-end
+require("getchoo.plugins")
diff --git a/lua/getchoo/keybinds.lua b/lua/getchoo/keybinds.lua
index a71f606..7dab12e 100644
--- a/lua/getchoo/keybinds.lua
+++ b/lua/getchoo/keybinds.lua
@@ -5,9 +5,20 @@ local set = function(mode, key, vimcmd)
vim.keymap.set(mode, key, vimcmd, opts)
end
-set("n", "<leader>t", function()
- vim.cmd("NvimTreeToggle")
-end)
+if pcall(require, "neo-tree.command") then
+ set("n", "<leader>t", function()
+ require("neo-tree.command").execute({
+ toggle = true,
+ dir = vim.loop.cwd(),
+ })
+ end)
+end
+
+if pcall(require, "flash") then
+ set({ "n", "o", "x" }, "s", function()
+ require("flash").jump()
+ end)
+end
for i = 1, 9 do
set("n", "<leader>" .. i, function()
diff --git a/lua/getchoo/plugins/general.lua b/lua/getchoo/plugins/general.lua
index 3c89ea6..f9a0c2c 100644
--- a/lua/getchoo/plugins/general.lua
+++ b/lua/getchoo/plugins/general.lua
@@ -1,8 +1,3 @@
----- autopairs
-require("nvim-autopairs").setup({
- disable_filetype = { "TeleScopePrompt" },
-})
-
---- catppuccin
local compile_path = vim.fn.stdpath("cache") .. "/catppuccin-nvim"
vim.fn.mkdir(compile_path, "p")
@@ -12,14 +7,13 @@ require("catppuccin").setup({
compile_path = compile_path,
flavour = "mocha", -- mocha, macchiato, frappe, latte
integrations = {
- barbar = true,
cmp = true,
+ flash = true,
gitsigns = true,
- leap = true,
native_lsp = {
enabled = true,
},
- nvimtree = true,
+ neotree = true,
treesitter_context = true,
treesitter = true,
telescope = true,
@@ -38,29 +32,76 @@ require("bufferline").setup({
mode = "buffers",
numbers = "ordinal",
separator_style = "slant",
+ offsets = {
+ {
+ filetype = "neo-tree",
+ text = "neo-tree",
+ highlight = "Directory",
+ text_align = "left",
+ },
+ },
},
})
---- gitsigns
require("gitsigns").setup()
----- leap
-require("leap").add_default_mappings()
+---- indent-blankline.nvim
+require("indent_blankline").setup({
+ filetype_exclude = {
+ "help",
+ "neo-tree",
+ "Trouble",
+ "lazy",
+ "mason",
+ "notify",
+ "toggleterm",
+ },
+ show_trailing_blankline_indent = false,
+ show_current_context = false,
+})
---- lualine
require("lualine").setup({
options = {
theme = "catppuccin",
},
- extensions = { "nvim-tree" },
+ extensions = { "neo-tree", "trouble" },
+})
+
+---- mini.nvim
+require("mini.pairs").setup({})
+require("mini.indentscope").setup({
+ options = { try_as_border = true },
+})
+
+vim.api.nvim_create_autocmd("FileType", {
+ pattern = {
+ "help",
+ "neo-tree",
+ "Trouble",
+ "lazy",
+ "mason",
+ "notify",
+ "toggleterm",
+ },
+ callback = function()
+ vim.b.miniindentscope_disable = true
+ end,
})
---- nvim-tree
-require("nvim-tree").setup()
+require("neo-tree").setup({
+ sources = { "filesystem", "buffers", "git_status", "document_symbols" },
+ open_files_do_not_replace_types = { "terminal", "Trouble", "qf", "Outline" },
+ filesystem = {
+ bind_to_cwd = false,
+ follow_current_file = { enabled = true },
+ use_libuv_file_watcher = true,
+ },
+})
----- treesitter
-require("nvim-treesitter.configs").setup({
- auto_install = false,
- highlight = { enable = true },
- indent = { enable = true },
+---- which-key
+require("which-key").setup({
+ plugins = { spelling = true },
})
diff --git a/lua/getchoo/plugins/init.lua b/lua/getchoo/plugins/init.lua
index f0e8a44..95883c7 100644
--- a/lua/getchoo/plugins/init.lua
+++ b/lua/getchoo/plugins/init.lua
@@ -1,6 +1,3 @@
-if vim.g.use_lazy then
- require("getchoo.plugins.lazy")
-end
-
require("getchoo.plugins.general")
require("getchoo.plugins.lsp")
+require("getchoo.plugins.ui")
diff --git a/lua/getchoo/plugins/lazy.lua b/lua/getchoo/plugins/lazy.lua
index bdd6dc3..e11572c 100644
--- a/lua/getchoo/plugins/lazy.lua
+++ b/lua/getchoo/plugins/lazy.lua
@@ -17,21 +17,44 @@ vim.opt.rtp:prepend(lazy_path)
require("lazy").setup({
{ "akinsho/bufferline.nvim", version = "*", dependencies = "nvim-tree/nvim-web-devicons" },
{ "catppuccin/nvim", name = "catppuccin", priority = 1000 },
- "hrsh7th/nvim-cmp",
- "hrsh7th/cmp-nvim-lsp",
- "hrsh7th/cmp-buffer",
- "saadparwaiz1/cmp_luasnip",
- "FelipeLema/cmp-async-path",
+ {
+ "hrsh7th/nvim-cmp",
+ dependencies = {
+ "hrsh7th/cmp-nvim-lsp",
+ "hrsh7th/cmp-buffer",
+ "saadparwaiz1/cmp_luasnip",
+ "FelipeLema/cmp-async-path",
+ "L3MON4D3/LuaSnip",
+ },
+ },
+ { "stevearc/dressing.nvim", lazy = true },
{ "j-hui/fidget.nvim", tag = "legacy" },
"lewis6991/gitsigns.nvim",
{ "folke/flash.nvim", event = "VeryLazy" },
+ "lukas-reineke/indent-blankline.nvim",
{ "nvim-lualine/lualine.nvim", dependencies = "nvim-tree/nvim-web-devicons" },
- "L3MON4D3/LuaSnip",
- { "echasnovski/mini.pairs", event = "VeryLazy" },
+ { "echasnovski/mini.nvim", version = false, event = "VeryLazy" },
+ { "folke/noice.nvim", event = "VeryLazy" },
+ { "MunifTanjim/nui.nvim", lazy = true },
"neovim/nvim-lspconfig",
- { "nvim-tree/nvim-tree.lua", dependencies = "nvim-tree/nvim-web-devicons" },
- "nvim-treesitter/nvim-treesitter",
+ "rcarriga/nvim-notify",
+ {
+ "nvim-treesitter/nvim-treesitter",
+ dependencies = {
+ "JoosepAlviste/nvim-ts-context-commentstring",
+ },
+ },
"nvim-lua/plenary.nvim",
+ {
+ "nvim-neo-tree/neo-tree.nvim",
+ branch = "v3.x",
+ dependencies = {
+ "nvim-lua/plenary.nvim",
+ "nvim-tree/nvim-web-devicons",
+ "MunifTanjim/nui.nvim",
+ },
+ },
{ "nvim-telescope/telescope.nvim", tag = "0.1.2" },
{ "folke/trouble.nvim", dependencies = { "nvim-tree/nvim-web-devicons" } },
+ { "folke/which-key.nvim", event = "VeryLazy" },
})
diff --git a/lua/getchoo/plugins/lsp.lua b/lua/getchoo/plugins/lsp.lua
index b9e8a78..82511dc 100644
--- a/lua/getchoo/plugins/lsp.lua
+++ b/lua/getchoo/plugins/lsp.lua
@@ -36,6 +36,9 @@ require("cmp").setup({
}),
})
+---- gitsigns
+require("gitsigns").setup()
+
---- fidget
require("fidget").setup()
@@ -152,10 +155,29 @@ local formatting_on_attach = function(client, bufnr)
end
end
+require("mini.comment").setup({
+ options = {
+ custom_commentstring = function()
+ return require("ts_context_commentstring.internal").calculate_commentstring()
+ or vim.bo.context_commentstring
+ end,
+ },
+})
+
require("null-ls").setup({
on_attach = formatting_on_attach,
sources = sources.null_ls,
})
+require("nvim-treesitter.configs").setup({
+ auto_install = false,
+ highlight = { enable = true },
+ indent = { enable = true },
+ context_commentstring = {
+ enable = true,
+ enable_autocmd = false,
+ },
+})
+
---- trouble
require("trouble").setup()
diff --git a/lua/getchoo/plugins/ui.lua b/lua/getchoo/plugins/ui.lua
new file mode 100644
index 0000000..3a0cc2e
--- /dev/null
+++ b/lua/getchoo/plugins/ui.lua
@@ -0,0 +1,40 @@
+require("dressing")
+
+vim.notify = require("notify")
+
+vim.ui.select = function(...)
+ return vim.ui.select(...)
+end
+
+vim.ui.input = function(...)
+ return vim.ui.input(...)
+end
+
+require("noice").setup({
+ lsp = {
+ override = {
+ ["vim.lsp.util.convert_input_to_markdown_lines"] = true,
+ ["vim.lsp.util.stylize_markdown"] = true,
+ ["cmp.entry.get_documentation"] = true,
+ },
+ },
+ routes = {
+ {
+ filter = {
+ event = "msg_show",
+ any = {
+ { find = "%d+L, %d+B" },
+ { find = "; after #%d+" },
+ { find = "; before #%d+" },
+ },
+ },
+ view = "mini",
+ },
+ },
+ presets = {
+ bottom_search = true,
+ command_palette = true,
+ long_message_to_split = true,
+ inc_rename = true,
+ },
+})