apply fmt

This commit is contained in:
Erica Marigold 2024-03-05 12:24:50 +05:30
parent 02a69964d1
commit 7f5fbbf08b
No known key found for this signature in database
GPG key ID: 2768CC0C23D245D1
28 changed files with 1584 additions and 1606 deletions

View file

@ -1,6 +1,6 @@
vim.filetype.add({ vim.filetype.add {
extension = { extension = {
mdx = "mdx", mdx = "mdx",
luau = "luau" luau = "luau",
}, },
}) }

View file

@ -1,24 +1,24 @@
-- Basic settings -- Basic settings
require("basic") require "basic"
-- Load plugins -- Load plugins
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ vim.fn.system {
"git", "git",
"clone", "clone",
"--filter=blob:none", "--filter=blob:none",
"https://github.com/folke/lazy.nvim.git", "https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release "--branch=stable", -- latest stable release
lazypath, lazypath,
}) }
end end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
vim.g.mapleader = require("custom_keys").leader vim.g.mapleader = require("custom_keys").leader
vim.g.maplocalleader = "\\" vim.g.maplocalleader = "\\"
require("lazy").setup({ require("lazy").setup {
spec = { spec = {
{ import = "plugins" }, { import = "plugins" },
{ import = "languages" }, { import = "languages" },
@ -31,8 +31,8 @@ require("lazy").setup({
enabled = true, enabled = true,
notify = false, -- get a notification when changes are found notify = false, -- get a notification when changes are found
}, },
}) }
-- Final settings -- Final settings
require("core") require "core"
pcall(require, "custom") pcall(require, "custom")

View file

@ -1,4 +1,4 @@
HOME = os.getenv("HOME") HOME = os.getenv "HOME"
vim.opt.termguicolors = true vim.opt.termguicolors = true
vim.opt.cursorline = true vim.opt.cursorline = true
@ -75,11 +75,11 @@ vim.opt.wildignore =
-- augroup END -- augroup END
-- ]]) -- ]])
vim.cmd([[ vim.cmd [[
set noeb set noeb
set t_Co=256 set t_Co=256
filetype plugin indent on filetype plugin indent on
exec "nohlsearch" exec "nohlsearch"
syntax enable syntax enable
syntax on syntax on
]]) ]]

View file

@ -1,5 +1,5 @@
local keys = require("custom_keys") local keys = require "custom_keys"
local opts = require("custom_opts") local opts = require "custom_opts"
-- Setup keymapping -- Setup keymapping
local function set_keymap() local function set_keymap()
@ -13,29 +13,29 @@ local function set_keymap()
map("n", keys.jump_up_window, "<C-W>k", option) map("n", keys.jump_up_window, "<C-W>k", option)
map("n", keys.jump_right_window, "<C-W>l", option) map("n", keys.jump_right_window, "<C-W>l", option)
vim.cmd([[ vim.cmd [[
" press esc to cancel search highlight " press esc to cancel search highlight
nnoremap <silent> <Esc> :nohlsearch<CR>:echo<CR> nnoremap <silent> <Esc> :nohlsearch<CR>:echo<CR>
]]) ]]
-- Remove the `~` for blank lines by setting its color to be the same as background -- Remove the `~` for blank lines by setting its color to be the same as background
vim.cmd("hi NonText guifg=bg") vim.cmd "hi NonText guifg=bg"
-- for markdown file -- for markdown file
vim.cmd([[ vim.cmd [[
" optimized up and down move when set wrap for markdown file " optimized up and down move when set wrap for markdown file
autocmd FileType markdown noremap <buffer> j gj autocmd FileType markdown noremap <buffer> j gj
autocmd FileType markdown noremap <buffer> k gk autocmd FileType markdown noremap <buffer> k gk
autocmd FileType markdown setlocal wrap autocmd FileType markdown setlocal wrap
]]) ]]
-- Supported by bufdelete -- Supported by bufdelete
vim.cmd([[ vim.cmd [[
cnoreabbrev bdelete Bdelete cnoreabbrev bdelete Bdelete
cnoreabbrev bdelete! Bdelete! cnoreabbrev bdelete! Bdelete!
cnoreabbrev bwipeout Bwipeout cnoreabbrev bwipeout Bwipeout
cnoreabbrev bwipeout! Bwipeout! cnoreabbrev bwipeout! Bwipeout!
]]) ]]
-- Supported by bufferline -- Supported by bufferline
map("n", keys.pick_tab, ":BufferLinePick<CR>", option) map("n", keys.pick_tab, ":BufferLinePick<CR>", option)
@ -53,7 +53,7 @@ local function set_keymap()
-- Supported by toggleterm -- Supported by toggleterm
-- float terminal -- float terminal
local float_terminal_default = require("toggleterm.terminal").Terminal:new({ local float_terminal_default = require("toggleterm.terminal").Terminal:new {
direction = "float", direction = "float",
on_open = function(term) on_open = function(term)
-- forced to change the working dir for terminal -- forced to change the working dir for terminal
@ -64,19 +64,19 @@ local function set_keymap()
end end
-- when float term opened, disable bottom terminal -- when float term opened, disable bottom terminal
vim.api.nvim_del_keymap("t", keys.terminal_bottom) vim.api.nvim_del_keymap("t", keys.terminal_bottom)
vim.cmd("startinsert!") vim.cmd "startinsert!"
end, end,
on_close = function(t, job, exit_code, name) on_close = function(t, job, exit_code, name)
-- when float term closed, enable bottom terminal -- when float term closed, enable bottom terminal
map("t", keys.terminal_bottom, "<C-\\><C-n>:lua _bottom_term_toggle()<CR>", option) map("t", keys.terminal_bottom, "<C-\\><C-n>:lua _bottom_term_toggle()<CR>", option)
end, end,
}) }
function _float_term_toggle() function _float_term_toggle()
float_terminal_default:toggle() float_terminal_default:toggle()
end end
-- bottom terminal -- bottom terminal
local bottom_terminal_default = require("toggleterm.terminal").Terminal:new({ local bottom_terminal_default = require("toggleterm.terminal").Terminal:new {
direction = "horizontal", direction = "horizontal",
on_open = function(term) on_open = function(term)
-- forced to change the working dir for terminal -- forced to change the working dir for terminal
@ -88,40 +88,16 @@ local function set_keymap()
-- set keymapping -- set keymapping
local opts = { buffer = 0 } local opts = { buffer = 0 }
vim.api.nvim_buf_set_keymap( vim.api.nvim_buf_set_keymap(term.bufnr, "t", "<C-h>", [[<Cmd>wincmd h<CR>]], { noremap = true, silent = true })
term.bufnr, vim.api.nvim_buf_set_keymap(term.bufnr, "t", "<C-j>", [[<Cmd>wincmd j<CR>]], { noremap = true, silent = true })
"t", vim.api.nvim_buf_set_keymap(term.bufnr, "t", "<C-k>", [[<Cmd>wincmd k<CR>]], { noremap = true, silent = true })
"<C-h>", vim.api.nvim_buf_set_keymap(term.bufnr, "t", "<C-l>", [[<Cmd>wincmd l<CR>]], { noremap = true, silent = true })
[[<Cmd>wincmd h<CR>]], vim.cmd "startinsert!"
{ noremap = true, silent = true }
)
vim.api.nvim_buf_set_keymap(
term.bufnr,
"t",
"<C-j>",
[[<Cmd>wincmd j<CR>]],
{ noremap = true, silent = true }
)
vim.api.nvim_buf_set_keymap(
term.bufnr,
"t",
"<C-k>",
[[<Cmd>wincmd k<CR>]],
{ noremap = true, silent = true }
)
vim.api.nvim_buf_set_keymap(
term.bufnr,
"t",
"<C-l>",
[[<Cmd>wincmd l<CR>]],
{ noremap = true, silent = true }
)
vim.cmd("startinsert!")
end, end,
on_exit = function(t, job, exit_code, name) on_exit = function(t, job, exit_code, name)
vim.cmd("quit!") vim.cmd "quit!"
end, end,
}) }
function _bottom_term_toggle() function _bottom_term_toggle()
bottom_terminal_default:toggle() bottom_terminal_default:toggle()
end end
@ -131,10 +107,10 @@ local function set_keymap()
map("n", keys.terminal_bottom, ":lua _bottom_term_toggle()<CR>", option) map("n", keys.terminal_bottom, ":lua _bottom_term_toggle()<CR>", option)
map("t", keys.terminal_bottom, "<C-\\><C-n>:lua _bottom_term_toggle()<CR>", option) map("t", keys.terminal_bottom, "<C-\\><C-n>:lua _bottom_term_toggle()<CR>", option)
vim.cmd([[ vim.cmd [[
command! Termfloat :lua _float_term_toggle() command! Termfloat :lua _float_term_toggle()
]]) ]]
vim.cmd([[cnoreabbrev terminal Termfloat]]) vim.cmd [[cnoreabbrev terminal Termfloat]]
-- Supported by nvim-session-manager -- Supported by nvim-session-manager
map("n", keys.switch_session, ":SessionManager load_session<CR>", option) map("n", keys.switch_session, ":SessionManager load_session<CR>", option)

View file

@ -19,8 +19,8 @@ return {
close_message_notify = false, close_message_notify = false,
-- Starting screen header. -- Starting screen header.
home_header = home_header = strsplit(
strsplit([[ [[
@ -40,5 +40,7 @@ return {
]], "\n") ]],
"\n"
),
} }

View file

@ -7,14 +7,14 @@ return {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
}, },
config = function() config = function()
require("go").setup({ require("go").setup {
run_in_floaterm = true, run_in_floaterm = true,
floaterm = { floaterm = {
posititon = "center", -- one of {`top`, `bottom`, `left`, `right`, `center`, `auto`} posititon = "center", -- one of {`top`, `bottom`, `left`, `right`, `center`, `auto`}
width = 0.45, -- width of float window if not auto width = 0.45, -- width of float window if not auto
height = 0.98, -- height of float window if not auto height = 0.98, -- height of float window if not auto
}, },
}) }
end, end,
event = { "CmdlineEnter" }, event = { "CmdlineEnter" },
ft = { "go", "gomod" }, ft = { "go", "gomod" },

View file

@ -5,7 +5,7 @@ return {
}, },
config = function() config = function()
require("luau-lsp").setup({ require("luau-lsp").setup {
fflags = { fflags = {
sync = true, -- sync currently enabled fflags with roblox's published fflags sync = true, -- sync currently enabled fflags with roblox's published fflags
override = { override = {
@ -32,6 +32,6 @@ return {
types = { types = {
roblox = false, roblox = false,
}, },
}) }
end, end,
} }

View file

@ -1,11 +1,11 @@
return { return {
{ 'rust-lang/rust.vim' }, { "rust-lang/rust.vim" },
{ {
"simrat39/rust-tools.nvim", "simrat39/rust-tools.nvim",
lazy = true, lazy = true,
config = function() config = function()
local rt = require("rust-tools") local rt = require "rust-tools"
rt.setup({ rt.setup {
tools = { -- rust-tools options tools = { -- rust-tools options
-- how to execute terminal commands -- how to execute terminal commands
@ -178,7 +178,7 @@ return {
name = "rt_lldb", name = "rt_lldb",
}, },
}, },
}) }
end, end,
}, },
} }

View file

@ -1,38 +1,38 @@
return function() return function()
local cmp = require("cmp") local cmp = require "cmp"
cmp.setup({ cmp.setup {
snippet = { snippet = {
-- Select the luasnip engine here. You can switch to another engine. -- Select the luasnip engine here. You can switch to another engine.
expand = function(args) expand = function(args)
-- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. -- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
require('luasnip').lsp_expand(args.body) -- For `luasnip` users. require("luasnip").lsp_expand(args.body) -- For `luasnip` users.
-- require('snippy').expand_snippet(args.body) -- For `snippy` users. -- require('snippy').expand_snippet(args.body) -- For `snippy` users.
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
end, end,
}, },
window = { window = {
completion = cmp.config.window.bordered({ completion = cmp.config.window.bordered {
border = "rounded", border = "rounded",
winhighlight = "", winhighlight = "",
minwidth = 60, minwidth = 60,
}), },
documentation = cmp.config.window.bordered({ documentation = cmp.config.window.bordered {
border = "rounded", border = "rounded",
winhighlight = "", winhighlight = "",
}), },
}, },
formatting = { formatting = {
format = require("lspkind").cmp_format({ format = require("lspkind").cmp_format {
mode = "symbol_text", mode = "symbol_text",
}),
}, },
mapping = cmp.mapping.preset.insert({ },
mapping = cmp.mapping.preset.insert {
["<C-b>"] = cmp.mapping.scroll_docs(-4), ["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4), ["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(), ["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(), ["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. ["<CR>"] = cmp.mapping.confirm { select = true }, -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
["<Tab>"] = function(fallback) ["<Tab>"] = function(fallback)
if cmp.visible() then if cmp.visible() then
cmp.select_next_item() cmp.select_next_item()
@ -40,14 +40,14 @@ return function()
fallback() fallback()
end end
end, end,
}), },
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = "nvim_lsp" }, { name = "nvim_lsp" },
}, { }, {
{ name = "buffer" }, { name = "buffer" },
{ name = "path" }, { name = "path" },
}), }),
}) }
-- `/` cmdline setup. -- `/` cmdline setup.
cmp.setup.cmdline("/", { cmp.setup.cmdline("/", {
@ -73,6 +73,6 @@ return function()
}) })
-- If you want insert `(` after select function or method item -- If you want insert `(` after select function or method item
local cmp_autopairs = require("nvim-autopairs.completion.cmp") local cmp_autopairs = require "nvim-autopairs.completion.cmp"
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
end end

View file

@ -1,6 +1,6 @@
return function() return function()
local bufferline = require("bufferline") local bufferline = require "bufferline"
bufferline.setup({ bufferline.setup {
options = { options = {
mode = "buffers", -- set to "tabs" to only show tabpages instead mode = "buffers", -- set to "tabs" to only show tabpages instead
style_preset = bufferline.style_preset.default, -- or bufferline.style_preset.minimal, style_preset = bufferline.style_preset.default, -- or bufferline.style_preset.minimal,
@ -30,5 +30,5 @@ return function()
reveal = { "close" }, reveal = { "close" },
}, },
}, },
}) }
end end

View file

@ -11,10 +11,10 @@ return {
{ {
"windwp/nvim-autopairs", "windwp/nvim-autopairs",
config = function() config = function()
require("nvim-autopairs").setup({ require("nvim-autopairs").setup {
enable_check_bracket_line = false, enable_check_bracket_line = false,
ignored_next_char = "[%w%.]", -- will ignore alphanumeric and `.` symbol ignored_next_char = "[%w%.]", -- will ignore alphanumeric and `.` symbol
}) }
end, end,
}, },
@ -22,7 +22,7 @@ return {
{ {
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
config = function() config = function()
require("plugins/autocmp/config")() require "plugins/autocmp/config"()
end, end,
}, },
{ "hrsh7th/cmp-nvim-lsp" }, { "hrsh7th/cmp-nvim-lsp" },
@ -48,7 +48,7 @@ return {
"folke/todo-comments.nvim", "folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" }, dependencies = { "nvim-lua/plenary.nvim" },
config = function() config = function()
require("todo-comments").setup({ require("todo-comments").setup {
keywords = { keywords = {
FIX = { FIX = {
icon = "", -- icon used for the sign, and in search results icon = "", -- icon used for the sign, and in search results
@ -71,7 +71,7 @@ return {
default = { "Identifier", "#7C3AED" }, default = { "Identifier", "#7C3AED" },
test = { "Identifier", "#FF00FF" }, test = { "Identifier", "#FF00FF" },
}, },
}) }
end, end,
}, },
@ -79,7 +79,7 @@ return {
{ {
"nmac427/guess-indent.nvim", "nmac427/guess-indent.nvim",
config = function() config = function()
require("guess-indent").setup({}) require("guess-indent").setup {}
end, end,
}, },
} }

View file

@ -23,7 +23,7 @@ return {
"rose-pine/neovim", "rose-pine/neovim",
name = "rose-pine", name = "rose-pine",
config = function() config = function()
vim.cmd("colorscheme rose-pine-main") vim.cmd "colorscheme rose-pine-main"
end, end,
}, },
} }

View file

@ -1,18 +1,18 @@
return { return {
{ {
'nvim-telescope/telescope.nvim', "nvim-telescope/telescope.nvim",
dependencies = {{'nvim-lua/popup.nvim'}, {'nvim-lua/plenary.nvim'}}, dependencies = { { "nvim-lua/popup.nvim" }, { "nvim-lua/plenary.nvim" } },
config = function() config = function()
require'telescope'.setup{} require("telescope").setup {}
local option = { noremap = true, silent = true } local option = { noremap = true, silent = true }
local keys = require("custom_keys") local keys = require "custom_keys"
local builtin = require('telescope.builtin') local builtin = require "telescope.builtin"
vim.keymap.set('n', keys.find_files, builtin.find_files, option) vim.keymap.set("n", keys.find_files, builtin.find_files, option)
vim.keymap.set('n', keys.live_grep, builtin.live_grep, option) vim.keymap.set("n", keys.live_grep, builtin.live_grep, option)
vim.keymap.set('n', keys.search_cursor, builtin.grep_string, option) vim.keymap.set("n", keys.search_cursor, builtin.grep_string, option)
vim.keymap.set('n', keys.find_buffer, builtin.buffers, option) vim.keymap.set("n", keys.find_buffer, builtin.buffers, option)
end, end,
}, },
} }

View file

@ -3,12 +3,12 @@ return {
"lewis6991/gitsigns.nvim", "lewis6991/gitsigns.nvim",
dependencies = { "nvim-lua/plenary.nvim" }, dependencies = { "nvim-lua/plenary.nvim" },
config = function() config = function()
require("gitsigns").setup({ require("gitsigns").setup {
current_line_blame = true, current_line_blame = true,
preview_config = { preview_config = {
border = "rounded", border = "rounded",
}, },
}) }
end, end,
}, },

View file

@ -3,7 +3,7 @@ return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
config = function() config = function()
require("nvim-treesitter.configs").setup({ require("nvim-treesitter.configs").setup {
indent = { indent = {
enable = true, enable = true,
disable = {}, disable = {},
@ -25,10 +25,10 @@ return {
end, end,
additional_vim_regex_highlighting = false, additional_vim_regex_highlighting = false,
}, },
}) }
-- let it to use 'markdown' parser for mdx filetype. -- let it to use 'markdown' parser for mdx filetype.
vim.treesitter.language.register('markdown', 'mdx') vim.treesitter.language.register("markdown", "mdx")
end, end,
}, },
@ -36,11 +36,11 @@ return {
{ {
"NvChad/nvim-colorizer.lua", "NvChad/nvim-colorizer.lua",
config = function(plun) config = function(plun)
require("colorizer").setup({ require("colorizer").setup {
user_default_options = { user_default_options = {
names = false, names = false,
}, },
}) }
end, end,
}, },
} }

View file

@ -2,7 +2,7 @@ return {
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
config = function() config = function()
require("mason").setup({ require("mason").setup {
ui = { ui = {
icons = { icons = {
package_installed = "", package_installed = "",
@ -11,7 +11,7 @@ return {
}, },
border = "rounded", border = "rounded",
}, },
}) }
end, end,
}, },
@ -19,12 +19,12 @@ return {
"williamboman/mason-lspconfig.nvim", "williamboman/mason-lspconfig.nvim",
config = function() config = function()
require("mason-lspconfig").setup() require("mason-lspconfig").setup()
require("mason-lspconfig").setup_handlers({ require("mason-lspconfig").setup_handlers {
-- The first entry (without a key) will be the default handler -- The first entry (without a key) will be the default handler
-- and will be called for each installed server that doesn't have -- and will be called for each installed server that doesn't have
-- a dedicated handler. -- a dedicated handler.
function(server_name) -- default handler (optional) function(server_name) -- default handler (optional)
require("lspconfig")[server_name].setup({}) require("lspconfig")[server_name].setup {}
end, end,
-- Next, you can provide a dedicated handler for specific servers. -- Next, you can provide a dedicated handler for specific servers.
@ -32,14 +32,14 @@ return {
-- ["rust_analyzer"] = function () -- ["rust_analyzer"] = function ()
-- require("rust-tools").setup {} -- require("rust-tools").setup {}
-- end -- end
}) }
end, end,
}, },
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
config = function() config = function()
require("plugins/lspconfig/config")() require "plugins/lspconfig/config"()
end, end,
}, },
@ -47,10 +47,10 @@ return {
"jose-elias-alvarez/null-ls.nvim", "jose-elias-alvarez/null-ls.nvim",
dependencies = { "nvim-lua/plenary.nvim" }, dependencies = { "nvim-lua/plenary.nvim" },
config = function() config = function()
local null_ls = require("null-ls") local null_ls = require "null-ls"
local augroup = vim.api.nvim_create_augroup("LspFormatting", {}) local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
null_ls.setup({ null_ls.setup {
border = "rounded", border = "rounded",
cmd = { "nvim" }, cmd = { "nvim" },
debounce = 250, debounce = 250,
@ -81,7 +81,7 @@ return {
-- }) -- })
-- end -- end
--end, --end,
}) -- end of setup } -- end of setup
end, end,
}, },
@ -93,11 +93,11 @@ return {
"jose-elias-alvarez/null-ls.nvim", "jose-elias-alvarez/null-ls.nvim",
}, },
config = function() config = function()
require("mason-null-ls").setup({ require("mason-null-ls").setup {
automatic_setup = true, automatic_setup = true,
ensure_installed = { "shfmt", "prettier", "stylua" }, ensure_installed = { "shfmt", "prettier", "stylua" },
handlers = {}, handlers = {},
}) }
end, end,
}, },
} }

View file

@ -25,7 +25,7 @@ return function()
vim.keymap.set("n", require("custom_keys").goto_impl, vim.lsp.buf.implementation, opts) vim.keymap.set("n", require("custom_keys").goto_impl, vim.lsp.buf.implementation, opts)
vim.keymap.set("n", require("custom_keys").lsp_rename, vim.lsp.buf.rename, opts) vim.keymap.set("n", require("custom_keys").lsp_rename, vim.lsp.buf.rename, opts)
vim.keymap.set("n", require("custom_keys").format, function() vim.keymap.set("n", require("custom_keys").format, function()
vim.lsp.buf.format({ async = true }) vim.lsp.buf.format { async = true }
end, opts) end, opts)
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)

View file

@ -30,7 +30,7 @@ return function()
-- }, -- },
--} --}
require("lualine").setup({ require("lualine").setup {
options = { options = {
icons_enabled = true, icons_enabled = true,
theme = vim.g.hardhacker_lualine_theme, theme = vim.g.hardhacker_lualine_theme,
@ -131,5 +131,5 @@ return function()
winbar = {}, winbar = {},
inactive_winbar = {}, inactive_winbar = {},
extensions = {}, extensions = {},
}) }
end end

View file

@ -1,6 +1,6 @@
return function() return function()
-- Unless you are still migrating, remove the deprecated commands from v1.x -- Unless you are still migrating, remove the deprecated commands from v1.x
vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]]) vim.cmd [[ let g:neo_tree_remove_legacy_commands = 1 ]]
-- If you want icons for diagnostic errors, you'll need to define them somewhere: -- If you want icons for diagnostic errors, you'll need to define them somewhere:
vim.fn.sign_define("DiagnosticSignError", { text = "", texthl = "DiagnosticSignError" }) vim.fn.sign_define("DiagnosticSignError", { text = "", texthl = "DiagnosticSignError" })
@ -8,7 +8,7 @@ return function()
vim.fn.sign_define("DiagnosticSignInfo", { text = "", texthl = "DiagnosticSignInfo" }) vim.fn.sign_define("DiagnosticSignInfo", { text = "", texthl = "DiagnosticSignInfo" })
vim.fn.sign_define("DiagnosticSignHint", { text = "", texthl = "DiagnosticSignHint" }) vim.fn.sign_define("DiagnosticSignHint", { text = "", texthl = "DiagnosticSignHint" })
require("neo-tree").setup({ require("neo-tree").setup {
close_if_last_window = false, -- Close Neo-tree if it is the last window left in the tab close_if_last_window = false, -- Close Neo-tree if it is the last window left in the tab
popup_border_style = "rounded", popup_border_style = "rounded",
enable_git_status = true, enable_git_status = true,
@ -37,7 +37,7 @@ return function()
default_component_configs = { default_component_configs = {
container = { container = {
enable_character_fade = true enable_character_fade = true,
}, },
icon = { icon = {
folder_closed = "", folder_closed = "",
@ -67,7 +67,7 @@ return function()
conflict = "", conflict = "",
renamed = "󰁕", renamed = "󰁕",
unstaged = "󰄱", unstaged = "󰄱",
} },
}, },
}, },
@ -98,8 +98,8 @@ return function()
["a"] = { ["a"] = {
"add", "add",
config = { config = {
show_path = "none" -- "none", "relative", "absolute" show_path = "none", -- "none", "relative", "absolute"
} },
}, },
["A"] = "add_directory", -- also accepts the optional config.show_path option like "add". this also supports BASH style brace expansion. ["A"] = "add_directory", -- also accepts the optional config.show_path option like "add". this also supports BASH style brace expansion.
["d"] = "delete", ["d"] = "delete",
@ -114,7 +114,7 @@ return function()
["?"] = "show_help", ["?"] = "show_help",
["<"] = "prev_source", ["<"] = "prev_source",
[">"] = "next_source", [">"] = "next_source",
} },
}, },
filesystem = { filesystem = {
@ -173,7 +173,7 @@ return function()
}, },
}, },
commands = {} -- Add a custom command or override a global one using the same function name commands = {}, -- Add a custom command or override a global one using the same function name
}, },
buffers = { buffers = {
@ -186,7 +186,7 @@ return function()
["bd"] = "buffer_delete", ["bd"] = "buffer_delete",
["<bs>"] = "navigate_up", ["<bs>"] = "navigate_up",
["."] = "set_root", ["."] = "set_root",
} },
}, },
}, },
@ -201,8 +201,8 @@ return function()
["gc"] = "git_commit", ["gc"] = "git_commit",
["gp"] = "git_push", ["gp"] = "git_push",
["gg"] = "git_commit_and_push", ["gg"] = "git_commit_and_push",
}
}
}, },
}) },
},
}
end end

View file

@ -1,7 +1,7 @@
return function() return function()
local myopts = require("custom_opts") local myopts = require "custom_opts"
require("noice").setup({ require("noice").setup {
cmdline = { cmdline = {
enabled = true, -- enables the Noice cmdline UI enabled = true, -- enables the Noice cmdline UI
view = myopts.cmdline_view, -- view for rendering the cmdline. Change to `cmdline` to get a classic cmdline at the bottom view = myopts.cmdline_view, -- view for rendering the cmdline. Change to `cmdline` to get a classic cmdline at the bottom
@ -93,5 +93,5 @@ return function()
view = "notify", view = "notify",
replace = true, replace = true,
}, },
}) }
end end

View file

@ -1,5 +1,5 @@
return function() return function()
require('nvim-web-devicons').setup { require("nvim-web-devicons").setup {
-- your personnal icons can go here (to override) -- your personnal icons can go here (to override)
-- you can specify color or cterm_color instead of specifying both of them -- you can specify color or cterm_color instead of specifying both of them
-- DevIcon will be appended to `name` -- DevIcon will be appended to `name`
@ -8,37 +8,37 @@ return function()
icon = "", icon = "",
color = "#428850", color = "#428850",
cterm_color = "65", cterm_color = "65",
name = "Zsh" name = "Zsh",
} },
}; },
-- globally enable different highlight colors per icon (default to true) -- globally enable different highlight colors per icon (default to true)
-- if set to false all icons will have the default icon's color -- if set to false all icons will have the default icon's color
color_icons = true; color_icons = true,
-- globally enable default icons (default to false) -- globally enable default icons (default to false)
-- will get overriden by `get_icons` option -- will get overriden by `get_icons` option
default = true; default = true,
-- globally enable "strict" selection of icons - icon will be looked up in -- globally enable "strict" selection of icons - icon will be looked up in
-- different tables, first by filename, and if not found by extension; this -- different tables, first by filename, and if not found by extension; this
-- prevents cases when file doesn't have any extension but still gets some icon -- prevents cases when file doesn't have any extension but still gets some icon
-- because its name happened to match some extension (default to false) -- because its name happened to match some extension (default to false)
strict = true; strict = true,
-- same as `override` but specifically for overrides by filename -- same as `override` but specifically for overrides by filename
-- takes effect when `strict` is true -- takes effect when `strict` is true
override_by_filename = { override_by_filename = {
[".gitignore"] = { [".gitignore"] = {
icon = "", icon = "",
color = "#f1502f", color = "#f1502f",
name = "Gitignore" name = "Gitignore",
} },
}; },
-- same as `override` but specifically for overrides by extension -- same as `override` but specifically for overrides by extension
-- takes effect when `strict` is true -- takes effect when `strict` is true
override_by_extension = { override_by_extension = {
["log"] = { ["log"] = {
icon = "", icon = "",
color = "#81e043", color = "#81e043",
name = "Log" name = "Log",
} },
}; },
} }
end end

View file

@ -1,19 +1,19 @@
return function() return function()
require('smart-splits').setup({ require("smart-splits").setup {
ignored_filetypes = { ignored_filetypes = {
'nofile', "nofile",
'quickfix', "quickfix",
'prompt', "prompt",
'neo-tree', "neo-tree",
}, },
ignored_buftypes = { 'NvimTree', 'neo-tree' }, ignored_buftypes = { "NvimTree", "neo-tree" },
}) }
local keys = require("custom_keys") local keys = require "custom_keys"
local opttion = { noremap = true, silent = true } local opttion = { noremap = true, silent = true }
vim.keymap.set({'n', 't'}, keys.resize_left, require('smart-splits').resize_left, option) vim.keymap.set({ "n", "t" }, keys.resize_left, require("smart-splits").resize_left, option)
vim.keymap.set({'n', 't'}, keys.resize_down, require('smart-splits').resize_down, option) vim.keymap.set({ "n", "t" }, keys.resize_down, require("smart-splits").resize_down, option)
vim.keymap.set({'n', 't'}, keys.resize_up, require('smart-splits').resize_up, option) vim.keymap.set({ "n", "t" }, keys.resize_up, require("smart-splits").resize_up, option)
vim.keymap.set({'n', 't'}, keys.resize_right, require('smart-splits').resize_right, option) vim.keymap.set({ "n", "t" }, keys.resize_right, require("smart-splits").resize_right, option)
end end

View file

@ -6,15 +6,15 @@ return {
vim.g.alpha_statusline = false vim.g.alpha_statusline = false
end, end,
config = function() config = function()
local dashboard = require("alpha.themes.dashboard") local dashboard = require "alpha.themes.dashboard"
-- header, it's a logo -- header, it's a logo
dashboard.section.header.val = require("custom_opts").home_header dashboard.section.header.val = require("custom_opts").home_header
dashboard.section.header.opts.hl = "HardHackerRed" dashboard.section.header.opts.hl = "HardHackerRed"
-- footer -- footer
local handle = io.popen("fortune") local handle = io.popen "fortune"
local fortune = handle:read("*a") local fortune = handle:read "*a"
handle:close() handle:close()
dashboard.section.footer.val = fortune dashboard.section.footer.val = fortune
@ -39,19 +39,19 @@ return {
} }
-- config -- config
dashboard.config.layout[1].val = vim.fn.max({ 3, vim.fn.floor(vim.fn.winheight(0) * 0.3) }) dashboard.config.layout[1].val = vim.fn.max { 3, vim.fn.floor(vim.fn.winheight(0) * 0.3) }
dashboard.config.layout[3].val = 5 dashboard.config.layout[3].val = 5
dashboard.config.opts.noautocmd = true dashboard.config.opts.noautocmd = true
require("alpha").setup(dashboard.config) require("alpha").setup(dashboard.config)
-- disable the tabline & statusline in alpha dashboard screen -- disable the tabline & statusline in alpha dashboard screen
vim.cmd([[ vim.cmd [[
autocmd User AlphaReady set showtabline=0 | autocmd BufUnload <buffer> set showtabline=2 autocmd User AlphaReady set showtabline=0 | autocmd BufUnload <buffer> set showtabline=2
autocmd User AlphaReady set laststatus=0 | autocmd BufUnload <buffer> set laststatus=3 autocmd User AlphaReady set laststatus=0 | autocmd BufUnload <buffer> set laststatus=3
autocmd User AlphaReady :NeoTreeClose autocmd User AlphaReady :NeoTreeClose
autocmd User AlphaReady :AerialCloseAll autocmd User AlphaReady :AerialCloseAll
]]) ]]
end, end,
}, },
} }

View file

@ -3,9 +3,9 @@ return {
"akinsho/toggleterm.nvim", "akinsho/toggleterm.nvim",
version = "*", version = "*",
config = function() config = function()
local copts = require("custom_opts") local copts = require "custom_opts"
require("toggleterm").setup({ require("toggleterm").setup {
size = function(term) size = function(term)
if term.direction == "horizontal" then if term.direction == "horizontal" then
return 15 return 15
@ -34,12 +34,12 @@ return {
border = "rounded", border = "rounded",
-- winblend = copts.window_transparency, -- winblend = copts.window_transparency,
width = function(term) width = function(term)
local columns = vim.api.nvim_get_option("columns") local columns = vim.api.nvim_get_option "columns"
local w = math.floor(columns * copts.terminal_size) local w = math.floor(columns * copts.terminal_size)
return (w < 20) and 20 or w return (w < 20) and 20 or w
end, end,
height = function(term) height = function(term)
local lines = vim.api.nvim_get_option("lines") local lines = vim.api.nvim_get_option "lines"
local h = math.floor(lines * (copts.terminal_size + 0.1)) local h = math.floor(lines * (copts.terminal_size + 0.1))
return (h < 35) and 35 or h return (h < 35) and 35 or h
end, end,
@ -47,7 +47,7 @@ return {
persist_size = true, persist_size = true,
persist_mode = true, persist_mode = true,
autochdir = true, autochdir = true,
}) }
end, end,
}, },
} }

View file

@ -6,7 +6,7 @@ return {
"mrjones2014/smart-splits.nvim", "mrjones2014/smart-splits.nvim",
version = "v1.2.2", version = "v1.2.2",
config = function() config = function()
require("plugins/smart-split/config")() require "plugins/smart-split/config"()
end, end,
}, },
@ -18,10 +18,10 @@ return {
"Shatur/neovim-session-manager", "Shatur/neovim-session-manager",
dependencies = { "nvim-lua/plenary.nvim" }, dependencies = { "nvim-lua/plenary.nvim" },
config = function() config = function()
local Path = require("plenary.path") local Path = require "plenary.path"
local config = require("session_manager.config") local config = require "session_manager.config"
require("session_manager").setup({ require("session_manager").setup {
sessions_dir = Path:new(vim.fn.stdpath("data"), "sessions"), -- The directory where the session files will be saved. sessions_dir = Path:new(vim.fn.stdpath "data", "sessions"), -- The directory where the session files will be saved.
session_filename_to_dir = session_filename_to_dir, -- Function that replaces symbols into separators and colons to transform filename into a session directory. session_filename_to_dir = session_filename_to_dir, -- Function that replaces symbols into separators and colons to transform filename into a session directory.
dir_to_session_filename = dir_to_session_filename, -- Function that replaces separators and colons into special symbols to transform session directory into a filename. Should use `vim.loop.cwd()` if the passed `dir` is `nil`. dir_to_session_filename = dir_to_session_filename, -- Function that replaces separators and colons into special symbols to transform session directory into a filename. Should use `vim.loop.cwd()` if the passed `dir` is `nil`.
autoload_mode = config.AutoloadMode.Disabled, -- Define what to do when Neovim is started without arguments. Possible values: Disabled, CurrentDir, LastSession autoload_mode = config.AutoloadMode.Disabled, -- Define what to do when Neovim is started without arguments. Possible values: Disabled, CurrentDir, LastSession
@ -35,7 +35,7 @@ return {
autosave_ignore_buftypes = {}, -- All buffers of these bufer types will be closed before the session is saved. autosave_ignore_buftypes = {}, -- All buffers of these bufer types will be closed before the session is saved.
autosave_only_in_session = false, -- Always autosaves session. If true, only autosaves after a session is active. autosave_only_in_session = false, -- Always autosaves session. If true, only autosaves after a session is active.
max_path_length = 80, -- Shorten the display path if length exceeds this threshold. Use 0 if don't want to shorten the path at all. max_path_length = 80, -- Shorten the display path if length exceeds this threshold. Use 0 if don't want to shorten the path at all.
}) }
-- automatic open neotree sidebar when a session opened -- automatic open neotree sidebar when a session opened
local hardhacker_config_group = vim.api.nvim_create_augroup("HardHackerConfigGroup", {}) local hardhacker_config_group = vim.api.nvim_create_augroup("HardHackerConfigGroup", {})
@ -43,7 +43,7 @@ return {
pattern = "SessionLoadPost", pattern = "SessionLoadPost",
group = hardhacker_config_group, group = hardhacker_config_group,
callback = function() callback = function()
vim.api.nvim_command("Neotree position=left source=filesystem action=show") vim.api.nvim_command "Neotree position=left source=filesystem action=show"
end, end,
}) })
end, end,

View file

@ -9,10 +9,10 @@ return {
"nvim-tree/nvim-web-devicons", -- optional dependency "nvim-tree/nvim-web-devicons", -- optional dependency
}, },
config = function() config = function()
require("barbecue").setup({ require("barbecue").setup {
create_autocmd = false, -- prevent barbecue from updating itself automatically create_autocmd = false, -- prevent barbecue from updating itself automatically
theme = vim.g.hardhacker_barbecue_theme, theme = vim.g.hardhacker_barbecue_theme,
}) }
vim.api.nvim_create_autocmd({ vim.api.nvim_create_autocmd({
"WinScrolled", -- or WinResized on NVIM-v0.9 and higher "WinScrolled", -- or WinResized on NVIM-v0.9 and higher
@ -36,7 +36,7 @@ return {
"nvim-lualine/lualine.nvim", "nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons", opt = true }, dependencies = { "nvim-tree/nvim-web-devicons", opt = true },
config = function() config = function()
require("plugins/lualine/config")() require "plugins/lualine/config"()
end, end,
}, },
@ -50,7 +50,7 @@ return {
"MunifTanjim/nui.nvim", "MunifTanjim/nui.nvim",
}, },
config = function() config = function()
require("plugins/neo-tree/config")() require "plugins/neo-tree/config"()
end, end,
}, },
@ -64,10 +64,10 @@ return {
"nvim-tree/nvim-web-devicons", "nvim-tree/nvim-web-devicons",
}, },
config = function() config = function()
require("aerial").setup({ require("aerial").setup {
lazy_load = false, lazy_load = false,
open_automatic = require("custom_opts").auto_open_outline, open_automatic = require("custom_opts").auto_open_outline,
}) }
end, end,
}, },
@ -77,7 +77,7 @@ return {
version = "v4.1.0", version = "v4.1.0",
dependencies = "nvim-tree/nvim-web-devicons", dependencies = "nvim-tree/nvim-web-devicons",
config = function() config = function()
require("plugins/bufferline/config")() require "plugins/bufferline/config"()
end, end,
}, },
@ -89,7 +89,7 @@ return {
"rcarriga/nvim-notify", "rcarriga/nvim-notify",
}, },
config = function() config = function()
require("plugins/noice/config")() require "plugins/noice/config"()
end, end,
}, },