Skip to content

Commit

Permalink
refactor: reorg nvim
Browse files Browse the repository at this point in the history
  • Loading branch information
fisenkodv committed Mar 10, 2024
1 parent 916bfaa commit dff8543
Show file tree
Hide file tree
Showing 20 changed files with 260 additions and 659 deletions.
14 changes: 4 additions & 10 deletions config/nvim/lua/config/autocmds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
-- Add any additional autocmds here

-- Turn off paste mode when leaving insert
vim.api.nvim_create_autocmd("InsertLeave", {
pattern = "*",
command = "set nopaste",
})

-- Disable the concealing in some file formats
-- The default conceallevel is 3 in LazyVim
vim.api.nvim_create_autocmd("FileType", {
pattern = { "json", "jsonc", "markdown" },
callback = function()
vim.opt.conceallevel = 0
end,
pattern = { "json", "jsonc", "markdown" },
callback = function()
vim.opt.conceallevel = 0
end,
})
15 changes: 3 additions & 12 deletions config/nvim/lua/config/keymaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,6 @@ keymap.set("n", "<C-w><right>", "<C-w>>")
keymap.set("n", "<C-w><up>", "<C-w>+")
keymap.set("n", "<C-w><down>", "<C-w>-")

-- Diagnostics
keymap.set("n", "<C-j>", function()
vim.diagnostic.goto_next()
end, opts)

keymap.set("n", "<leader>r", function()
require("utils.utils").replaceHexWithHSL()
end)

keymap.set("n", "<leader>i", function()
require("utils.lsp").toggleInlayHints()
end)
-- keymap.set("n", "<leader>i", function()
-- require("utils.lsp").toggleInlayHints()
-- end)
94 changes: 43 additions & 51 deletions config/nvim/lua/config/lazy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,55 +7,47 @@ end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)

require("lazy").setup({
spec = {
-- add LazyVim and import its plugins
{
"LazyVim/LazyVim",
import = "lazyvim.plugins",
opts = { colorscheme = "solarized-osaka", news = { lazyvim = true, neovim = true } },
},
-- import any extras modules here
{ import = "lazyvim.plugins.extras.linting.eslint" },
{ import = "lazyvim.plugins.extras.formatting.prettier" },
{ import = "lazyvim.plugins.extras.lang.typescript" },
{ import = "lazyvim.plugins.extras.lang.json" },
{ import = "lazyvim.plugins.extras.lang.markdown" },
{ import = "lazyvim.plugins.extras.lang.rust" },
{ import = "lazyvim.plugins.extras.lang.tailwind" },
-- { import = "lazyvim.plugins.extras.dap.core" },
-- { import = "lazyvim.plugins.extras.vscode" },
{ import = "lazyvim.plugins.extras.util.mini-hipatterns" },
-- { import = "lazyvim.plugins.extras.test.core" },
-- { import = "lazyvim.plugins.extras.coding.yanky" },
-- { import = "lazyvim.plugins.extras.editor.mini-files" },
-- { import = "lazyvim.plugins.extras.util.project" },
{ import = "plugins" },
},
defaults = {
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
lazy = false,
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
-- have outdated releases, which may break your Neovim install.
version = false, -- always use the latest git commit
-- version = "*", -- try installing the latest stable version for plugins that support semver
},
checker = { enabled = true }, -- automatically check for plugin updates
performance = {
cache = { enabled = true },
rtp = {
-- disable some rtp plugins
disabled_plugins = {
"gzip",
-- "matchit",
-- "matchparen",
"netrwPlugin",
"rplugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
spec = {
-- add LazyVim and import its plugins
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
-- import any extras modules here
{ import = "lazyvim.plugins.extras.formatting.prettier" },
{ import = "lazyvim.plugins.extras.lang.typescript" },
{ import = "lazyvim.plugins.extras.lang.json" },
{ import = "lazyvim.plugins.extras.lang.markdown" },
{ import = "lazyvim.plugins.extras.lang.rust" },
{ import = "lazyvim.plugins.extras.linting.eslint" },
{ import = "lazyvim.plugins.extras.util.mini-hipatterns" },
{ import = "lazyvim.plugins.extras.ui.edgy" },
-- import/override with your plugins
{ import = "plugins" },
},
defaults = {
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
lazy = false,
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
-- have outdated releases, which may break your Neovim install.
version = false, -- always use the latest git commit
-- version = "*", -- try installing the latest stable version for plugins that support semver
},
install = { colorscheme = { "catppuccin", "tokyonight", "habamax" } },
checker = { enabled = true }, -- automatically check for plugin updates
performance = {
cache = { enabled = true },
rtp = {
-- disable some rtp plugins
disabled_plugins = {
"gzip",
-- "matchit",
-- "matchparen",
-- "netrwPlugin",
-- "rplugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})
7 changes: 1 addition & 6 deletions config/nvim/lua/config/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ vim.opt.wildignore:append({ "*/node_modules/*" })
vim.opt.splitbelow = true -- Put new windows below current
vim.opt.splitright = true -- Put new windows right of current
vim.opt.splitkeep = "cursor"
vim.opt.mouse = ""
vim.opt.mouse = "a"

-- Undercurl
vim.cmd([[let &t_Cs = "\e[4:3m"]])
Expand All @@ -44,9 +44,4 @@ vim.cmd([[let &t_Ce = "\e[4:0m"]])
-- Add asterisks in block comments
vim.opt.formatoptions:append({ "r" })

vim.cmd([[au BufNewFile,BufRead *.astro setf astro]])
vim.cmd([[au BufNewFile,BufRead Podfile setf ruby]])

if vim.fn.has("nvim-0.8") == 1 then
vim.opt.cmdheight = 0
end
12 changes: 12 additions & 0 deletions config/nvim/lua/plugins/bufferline.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
return {
{
"akinsho/bufferline.nvim",
opts = {
options = {
mode = "tabs",
show_buffer_close_icons = false,
show_close_icon = false,
},
},
},
}
97 changes: 0 additions & 97 deletions config/nvim/lua/plugins/coding.lua

This file was deleted.

38 changes: 28 additions & 10 deletions config/nvim/lua/plugins/colorscheme.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
return {
{
"craftzdog/solarized-osaka.nvim",
lazy = true,
priority = 1000,
opts = function()
return {
transparent = true,
}
end,
},
{
"LazyVim/LazyVim",
opts = {
colorscheme = "catppuccin-frappe",
},
},

-- {
-- "folke/tokyonight.nvim",
-- opts = {
-- transparent = true,
-- styles = {
-- sidebars = "transparent",
-- floats = "transparent",
-- },
-- },
-- },

-- {
-- "craftzdog/solarized-osaka.nvim",
-- lazy = true,
-- priority = 1000,
-- opts = function()
-- return {
-- transparent = true,
-- }
-- end,
-- },
}
9 changes: 9 additions & 0 deletions config/nvim/lua/plugins/inc-rename.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
return {
-- Incremental rename
{
"smjonas/inc-rename.nvim",
cmd = "IncRename",
config = true,
keys = { { "<leader>rn", ":IncRename ", desc = "Rename" } },
},
}
16 changes: 16 additions & 0 deletions config/nvim/lua/plugins/mason.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
return {
{
"williamboman/mason.nvim",
opts = function(_, opts)
vim.list_extend(opts.ensure_installed, {
"stylua",
"selene",
"luacheck",
"shellcheck",
"shfmt",
"typescript-language-server",
"css-lsp",
})
end,
},
}
17 changes: 17 additions & 0 deletions config/nvim/lua/plugins/mini-braketed.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
return {
-- Go forward/backward with square brackets
{
"echasnovski/mini.bracketed",
event = "BufReadPost",
config = function()
local bracketed = require("mini.bracketed")
bracketed.setup({
file = { suffix = "" },
window = { suffix = "" },
quickfix = { suffix = "" },
yank = { suffix = "" },
treesitter = { suffix = "n" },
})
end,
},
}
18 changes: 18 additions & 0 deletions config/nvim/lua/plugins/mini-hipatterns.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
return {
{
"echasnovski/mini.hipatterns",
event = "bufreadpre",
opts = {
highlighters = {
-- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE'
fixme = { pattern = "%f[%w]()FIXME()%f[%W]", group = "MiniHipatternsFixme" },
hack = { pattern = "%f[%w]()HACK()%f[%W]", group = "MiniHipatternsHack" },
todo = { pattern = "%f[%w]()TODO()%f[%W]", group = "MiniHipatternsTodo" },
note = { pattern = "%f[%w]()NOTE()%f[%W]", group = "MiniHipatternsNote" },

-- Highlight hex color strings (`#rrggbb`) using that color
hex_color = require("mini.hipatterns").gen_highlighter.hex_color(),
},
},
},
}
Loading

0 comments on commit dff8543

Please sign in to comment.