mirror of
https://github.com/CompeyDev/my-nvim-setup.git
synced 2025-01-06 01:59:08 +00:00
apply fmt
This commit is contained in:
parent
02a69964d1
commit
7f5fbbf08b
28 changed files with 1584 additions and 1606 deletions
|
@ -1,6 +1,6 @@
|
|||
vim.filetype.add({
|
||||
vim.filetype.add {
|
||||
extension = {
|
||||
mdx = "mdx",
|
||||
luau = "luau"
|
||||
luau = "luau",
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
14
init.lua
14
init.lua
|
@ -1,24 +1,24 @@
|
|||
-- Basic settings
|
||||
require("basic")
|
||||
require "basic"
|
||||
|
||||
-- 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
|
||||
vim.fn.system({
|
||||
vim.fn.system {
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
}
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
vim.g.mapleader = require("custom_keys").leader
|
||||
vim.g.maplocalleader = "\\"
|
||||
|
||||
require("lazy").setup({
|
||||
require("lazy").setup {
|
||||
spec = {
|
||||
{ import = "plugins" },
|
||||
{ import = "languages" },
|
||||
|
@ -31,8 +31,8 @@ require("lazy").setup({
|
|||
enabled = true,
|
||||
notify = false, -- get a notification when changes are found
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
-- Final settings
|
||||
require("core")
|
||||
require "core"
|
||||
pcall(require, "custom")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
HOME = os.getenv("HOME")
|
||||
HOME = os.getenv "HOME"
|
||||
|
||||
vim.opt.termguicolors = true
|
||||
vim.opt.cursorline = true
|
||||
|
@ -75,11 +75,11 @@ vim.opt.wildignore =
|
|||
-- augroup END
|
||||
-- ]])
|
||||
|
||||
vim.cmd([[
|
||||
vim.cmd [[
|
||||
set noeb
|
||||
set t_Co=256
|
||||
filetype plugin indent on
|
||||
exec "nohlsearch"
|
||||
syntax enable
|
||||
syntax on
|
||||
]])
|
||||
]]
|
||||
|
|
70
lua/core.lua
70
lua/core.lua
|
@ -1,5 +1,5 @@
|
|||
local keys = require("custom_keys")
|
||||
local opts = require("custom_opts")
|
||||
local keys = require "custom_keys"
|
||||
local opts = require "custom_opts"
|
||||
|
||||
-- Setup keymapping
|
||||
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_right_window, "<C-W>l", option)
|
||||
|
||||
vim.cmd([[
|
||||
vim.cmd [[
|
||||
" press esc to cancel search highlight
|
||||
nnoremap <silent> <Esc> :nohlsearch<CR>:echo<CR>
|
||||
]])
|
||||
]]
|
||||
|
||||
-- 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
|
||||
vim.cmd([[
|
||||
vim.cmd [[
|
||||
" optimized up and down move when set wrap for markdown file
|
||||
autocmd FileType markdown noremap <buffer> j gj
|
||||
autocmd FileType markdown noremap <buffer> k gk
|
||||
autocmd FileType markdown setlocal wrap
|
||||
]])
|
||||
]]
|
||||
|
||||
-- Supported by bufdelete
|
||||
vim.cmd([[
|
||||
vim.cmd [[
|
||||
cnoreabbrev bdelete Bdelete
|
||||
cnoreabbrev bdelete! Bdelete!
|
||||
cnoreabbrev bwipeout Bwipeout
|
||||
cnoreabbrev bwipeout! Bwipeout!
|
||||
]])
|
||||
]]
|
||||
|
||||
-- Supported by bufferline
|
||||
map("n", keys.pick_tab, ":BufferLinePick<CR>", option)
|
||||
|
@ -53,7 +53,7 @@ local function set_keymap()
|
|||
|
||||
-- Supported by toggleterm
|
||||
-- float terminal
|
||||
local float_terminal_default = require("toggleterm.terminal").Terminal:new({
|
||||
local float_terminal_default = require("toggleterm.terminal").Terminal:new {
|
||||
direction = "float",
|
||||
on_open = function(term)
|
||||
-- forced to change the working dir for terminal
|
||||
|
@ -64,19 +64,19 @@ local function set_keymap()
|
|||
end
|
||||
-- when float term opened, disable bottom terminal
|
||||
vim.api.nvim_del_keymap("t", keys.terminal_bottom)
|
||||
vim.cmd("startinsert!")
|
||||
vim.cmd "startinsert!"
|
||||
end,
|
||||
on_close = function(t, job, exit_code, name)
|
||||
-- when float term closed, enable bottom terminal
|
||||
map("t", keys.terminal_bottom, "<C-\\><C-n>:lua _bottom_term_toggle()<CR>", option)
|
||||
end,
|
||||
})
|
||||
}
|
||||
function _float_term_toggle()
|
||||
float_terminal_default:toggle()
|
||||
end
|
||||
|
||||
-- bottom terminal
|
||||
local bottom_terminal_default = require("toggleterm.terminal").Terminal:new({
|
||||
local bottom_terminal_default = require("toggleterm.terminal").Terminal:new {
|
||||
direction = "horizontal",
|
||||
on_open = function(term)
|
||||
-- forced to change the working dir for terminal
|
||||
|
@ -88,40 +88,16 @@ local function set_keymap()
|
|||
|
||||
-- set keymapping
|
||||
local opts = { buffer = 0 }
|
||||
vim.api.nvim_buf_set_keymap(
|
||||
term.bufnr,
|
||||
"t",
|
||||
"<C-h>",
|
||||
[[<Cmd>wincmd h<CR>]],
|
||||
{ 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!")
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, "t", "<C-h>", [[<Cmd>wincmd h<CR>]], { 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,
|
||||
on_exit = function(t, job, exit_code, name)
|
||||
vim.cmd("quit!")
|
||||
vim.cmd "quit!"
|
||||
end,
|
||||
})
|
||||
}
|
||||
function _bottom_term_toggle()
|
||||
bottom_terminal_default:toggle()
|
||||
end
|
||||
|
@ -131,10 +107,10 @@ local function set_keymap()
|
|||
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)
|
||||
|
||||
vim.cmd([[
|
||||
vim.cmd [[
|
||||
command! Termfloat :lua _float_term_toggle()
|
||||
]])
|
||||
vim.cmd([[cnoreabbrev terminal Termfloat]])
|
||||
]]
|
||||
vim.cmd [[cnoreabbrev terminal Termfloat]]
|
||||
|
||||
-- Supported by nvim-session-manager
|
||||
map("n", keys.switch_session, ":SessionManager load_session<CR>", option)
|
||||
|
|
|
@ -19,8 +19,8 @@ return {
|
|||
close_message_notify = false,
|
||||
|
||||
-- Starting screen header.
|
||||
home_header =
|
||||
strsplit([[
|
||||
home_header = strsplit(
|
||||
[[
|
||||
⢀⠀⢀⣀⣠⣤⣤⣤⣤⣤⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⣠⣠⣤⣤⣤⣤⣀⠲⢦⣄⡀⠀⠀
|
||||
⡶⢟⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⡀⠀⠀⠀⠀⠀⠰⣷⣷⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣬⡛⢷⣔
|
||||
⣾⡿⠟⠋⠉⠁⠀⡀⠀⠀⠀⠀⠈⠉⠉⠙⠛⢻⠛⠛⠋⠀⠀⠀⠀⠀⠀⠀⠈⠙⢛⣛⣛⣛⣛⣉⢉⣉⡀⠀⠀⠀⠀⠀⠈⠉⠛⢿⣷⣝
|
||||
|
@ -40,5 +40,7 @@ return {
|
|||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⣿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠟⠛⠛⠛⠛⠉⠉⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⠇⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠛⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠋⠀⠀⠀⠀⠀⠀⠀
|
||||
]], "\n")
|
||||
]],
|
||||
"\n"
|
||||
),
|
||||
}
|
||||
|
|
|
@ -7,14 +7,14 @@ return {
|
|||
"nvim-treesitter/nvim-treesitter",
|
||||
},
|
||||
config = function()
|
||||
require("go").setup({
|
||||
require("go").setup {
|
||||
run_in_floaterm = true,
|
||||
floaterm = {
|
||||
posititon = "center", -- one of {`top`, `bottom`, `left`, `right`, `center`, `auto`}
|
||||
width = 0.45, -- width of float window if not auto
|
||||
height = 0.98, -- height of float window if not auto
|
||||
},
|
||||
})
|
||||
}
|
||||
end,
|
||||
event = { "CmdlineEnter" },
|
||||
ft = { "go", "gomod" },
|
||||
|
|
|
@ -5,7 +5,7 @@ return {
|
|||
},
|
||||
|
||||
config = function()
|
||||
require("luau-lsp").setup({
|
||||
require("luau-lsp").setup {
|
||||
fflags = {
|
||||
sync = true, -- sync currently enabled fflags with roblox's published fflags
|
||||
override = {
|
||||
|
@ -32,6 +32,6 @@ return {
|
|||
types = {
|
||||
roblox = false,
|
||||
},
|
||||
})
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
return {
|
||||
{ 'rust-lang/rust.vim' },
|
||||
{ "rust-lang/rust.vim" },
|
||||
{
|
||||
"simrat39/rust-tools.nvim",
|
||||
lazy = true,
|
||||
config = function()
|
||||
local rt = require("rust-tools")
|
||||
rt.setup({
|
||||
local rt = require "rust-tools"
|
||||
rt.setup {
|
||||
tools = { -- rust-tools options
|
||||
|
||||
-- how to execute terminal commands
|
||||
|
@ -178,7 +178,7 @@ return {
|
|||
name = "rt_lldb",
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,38 +1,38 @@
|
|||
return function()
|
||||
local cmp = require("cmp")
|
||||
local cmp = require "cmp"
|
||||
|
||||
cmp.setup({
|
||||
cmp.setup {
|
||||
snippet = {
|
||||
-- Select the luasnip engine here. You can switch to another engine.
|
||||
expand = function(args)
|
||||
-- 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.
|
||||
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
||||
end,
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered({
|
||||
completion = cmp.config.window.bordered {
|
||||
border = "rounded",
|
||||
winhighlight = "",
|
||||
minwidth = 60,
|
||||
}),
|
||||
documentation = cmp.config.window.bordered({
|
||||
},
|
||||
documentation = cmp.config.window.bordered {
|
||||
border = "rounded",
|
||||
winhighlight = "",
|
||||
}),
|
||||
},
|
||||
},
|
||||
formatting = {
|
||||
format = require("lspkind").cmp_format({
|
||||
format = require("lspkind").cmp_format {
|
||||
mode = "symbol_text",
|
||||
}),
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert {
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<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)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
|
@ -40,14 +40,14 @@ return function()
|
|||
fallback()
|
||||
end
|
||||
end,
|
||||
}),
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
}, {
|
||||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
}),
|
||||
})
|
||||
}
|
||||
|
||||
-- `/` cmdline setup.
|
||||
cmp.setup.cmdline("/", {
|
||||
|
@ -73,6 +73,6 @@ return function()
|
|||
})
|
||||
|
||||
-- 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())
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
return function()
|
||||
local bufferline = require("bufferline")
|
||||
bufferline.setup({
|
||||
local bufferline = require "bufferline"
|
||||
bufferline.setup {
|
||||
options = {
|
||||
mode = "buffers", -- set to "tabs" to only show tabpages instead
|
||||
style_preset = bufferline.style_preset.default, -- or bufferline.style_preset.minimal,
|
||||
|
@ -30,5 +30,5 @@ return function()
|
|||
reveal = { "close" },
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
end
|
||||
|
|
|
@ -11,10 +11,10 @@ return {
|
|||
{
|
||||
"windwp/nvim-autopairs",
|
||||
config = function()
|
||||
require("nvim-autopairs").setup({
|
||||
require("nvim-autopairs").setup {
|
||||
enable_check_bracket_line = false,
|
||||
ignored_next_char = "[%w%.]", -- will ignore alphanumeric and `.` symbol
|
||||
})
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
|
@ -22,7 +22,7 @@ return {
|
|||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
config = function()
|
||||
require("plugins/autocmp/config")()
|
||||
require "plugins/autocmp/config"()
|
||||
end,
|
||||
},
|
||||
{ "hrsh7th/cmp-nvim-lsp" },
|
||||
|
@ -48,7 +48,7 @@ return {
|
|||
"folke/todo-comments.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
require("todo-comments").setup({
|
||||
require("todo-comments").setup {
|
||||
keywords = {
|
||||
FIX = {
|
||||
icon = " ", -- icon used for the sign, and in search results
|
||||
|
@ -71,7 +71,7 @@ return {
|
|||
default = { "Identifier", "#7C3AED" },
|
||||
test = { "Identifier", "#FF00FF" },
|
||||
},
|
||||
})
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
|
@ -79,7 +79,7 @@ return {
|
|||
{
|
||||
"nmac427/guess-indent.nvim",
|
||||
config = function()
|
||||
require("guess-indent").setup({})
|
||||
require("guess-indent").setup {}
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ return {
|
|||
"rose-pine/neovim",
|
||||
name = "rose-pine",
|
||||
config = function()
|
||||
vim.cmd("colorscheme rose-pine-main")
|
||||
vim.cmd "colorscheme rose-pine-main"
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
return {
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
dependencies = {{'nvim-lua/popup.nvim'}, {'nvim-lua/plenary.nvim'}},
|
||||
"nvim-telescope/telescope.nvim",
|
||||
dependencies = { { "nvim-lua/popup.nvim" }, { "nvim-lua/plenary.nvim" } },
|
||||
config = function()
|
||||
require'telescope'.setup{}
|
||||
require("telescope").setup {}
|
||||
|
||||
local option = { noremap = true, silent = true }
|
||||
|
||||
local keys = require("custom_keys")
|
||||
local builtin = require('telescope.builtin')
|
||||
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.search_cursor, builtin.grep_string, option)
|
||||
vim.keymap.set('n', keys.find_buffer, builtin.buffers, option)
|
||||
local keys = require "custom_keys"
|
||||
local builtin = require "telescope.builtin"
|
||||
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.search_cursor, builtin.grep_string, option)
|
||||
vim.keymap.set("n", keys.find_buffer, builtin.buffers, option)
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -3,12 +3,12 @@ return {
|
|||
"lewis6991/gitsigns.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
require("gitsigns").setup({
|
||||
require("gitsigns").setup {
|
||||
current_line_blame = true,
|
||||
preview_config = {
|
||||
border = "rounded",
|
||||
},
|
||||
})
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ return {
|
|||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
require("nvim-treesitter.configs").setup {
|
||||
indent = {
|
||||
enable = true,
|
||||
disable = {},
|
||||
|
@ -25,10 +25,10 @@ return {
|
|||
end,
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
-- let it to use 'markdown' parser for mdx filetype.
|
||||
vim.treesitter.language.register('markdown', 'mdx')
|
||||
vim.treesitter.language.register("markdown", "mdx")
|
||||
end,
|
||||
},
|
||||
|
||||
|
@ -36,11 +36,11 @@ return {
|
|||
{
|
||||
"NvChad/nvim-colorizer.lua",
|
||||
config = function(plun)
|
||||
require("colorizer").setup({
|
||||
require("colorizer").setup {
|
||||
user_default_options = {
|
||||
names = false,
|
||||
},
|
||||
})
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ return {
|
|||
{
|
||||
"williamboman/mason.nvim",
|
||||
config = function()
|
||||
require("mason").setup({
|
||||
require("mason").setup {
|
||||
ui = {
|
||||
icons = {
|
||||
package_installed = "✓",
|
||||
|
@ -11,7 +11,7 @@ return {
|
|||
},
|
||||
border = "rounded",
|
||||
},
|
||||
})
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
|
@ -19,12 +19,12 @@ return {
|
|||
"williamboman/mason-lspconfig.nvim",
|
||||
config = function()
|
||||
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
|
||||
-- and will be called for each installed server that doesn't have
|
||||
-- a dedicated handler.
|
||||
function(server_name) -- default handler (optional)
|
||||
require("lspconfig")[server_name].setup({})
|
||||
require("lspconfig")[server_name].setup {}
|
||||
end,
|
||||
|
||||
-- Next, you can provide a dedicated handler for specific servers.
|
||||
|
@ -32,14 +32,14 @@ return {
|
|||
-- ["rust_analyzer"] = function ()
|
||||
-- require("rust-tools").setup {}
|
||||
-- end
|
||||
})
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
require("plugins/lspconfig/config")()
|
||||
require "plugins/lspconfig/config"()
|
||||
end,
|
||||
},
|
||||
|
||||
|
@ -47,10 +47,10 @@ return {
|
|||
"jose-elias-alvarez/null-ls.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
local null_ls = require("null-ls")
|
||||
local null_ls = require "null-ls"
|
||||
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
||||
|
||||
null_ls.setup({
|
||||
null_ls.setup {
|
||||
border = "rounded",
|
||||
cmd = { "nvim" },
|
||||
debounce = 250,
|
||||
|
@ -81,7 +81,7 @@ return {
|
|||
-- })
|
||||
-- end
|
||||
--end,
|
||||
}) -- end of setup
|
||||
} -- end of setup
|
||||
end,
|
||||
},
|
||||
|
||||
|
@ -93,11 +93,11 @@ return {
|
|||
"jose-elias-alvarez/null-ls.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("mason-null-ls").setup({
|
||||
require("mason-null-ls").setup {
|
||||
automatic_setup = true,
|
||||
ensure_installed = { "shfmt", "prettier", "stylua" },
|
||||
handlers = {},
|
||||
})
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -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").lsp_rename, vim.lsp.buf.rename, opts)
|
||||
vim.keymap.set("n", require("custom_keys").format, function()
|
||||
vim.lsp.buf.format({ async = true })
|
||||
vim.lsp.buf.format { async = true }
|
||||
end, opts)
|
||||
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
|
||||
|
|
|
@ -30,7 +30,7 @@ return function()
|
|||
-- },
|
||||
--}
|
||||
|
||||
require("lualine").setup({
|
||||
require("lualine").setup {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = vim.g.hardhacker_lualine_theme,
|
||||
|
@ -131,5 +131,5 @@ return function()
|
|||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = {},
|
||||
})
|
||||
}
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
return function()
|
||||
-- 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:
|
||||
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("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
|
||||
popup_border_style = "rounded",
|
||||
enable_git_status = true,
|
||||
|
@ -37,7 +37,7 @@ return function()
|
|||
|
||||
default_component_configs = {
|
||||
container = {
|
||||
enable_character_fade = true
|
||||
enable_character_fade = true,
|
||||
},
|
||||
icon = {
|
||||
folder_closed = "",
|
||||
|
@ -67,7 +67,7 @@ return function()
|
|||
conflict = "",
|
||||
renamed = "",
|
||||
unstaged = "",
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
|
@ -98,8 +98,8 @@ return function()
|
|||
["a"] = {
|
||||
"add",
|
||||
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.
|
||||
["d"] = "delete",
|
||||
|
@ -114,7 +114,7 @@ return function()
|
|||
["?"] = "show_help",
|
||||
["<"] = "prev_source",
|
||||
[">"] = "next_source",
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
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 = {
|
||||
|
@ -186,7 +186,7 @@ return function()
|
|||
["bd"] = "buffer_delete",
|
||||
["<bs>"] = "navigate_up",
|
||||
["."] = "set_root",
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
|
@ -201,8 +201,8 @@ return function()
|
|||
["gc"] = "git_commit",
|
||||
["gp"] = "git_push",
|
||||
["gg"] = "git_commit_and_push",
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
return function()
|
||||
local myopts = require("custom_opts")
|
||||
local myopts = require "custom_opts"
|
||||
|
||||
require("noice").setup({
|
||||
require("noice").setup {
|
||||
cmdline = {
|
||||
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
|
||||
|
@ -93,5 +93,5 @@ return function()
|
|||
view = "notify",
|
||||
replace = true,
|
||||
},
|
||||
})
|
||||
}
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
return function()
|
||||
require('nvim-web-devicons').setup {
|
||||
require("nvim-web-devicons").setup {
|
||||
-- your personnal icons can go here (to override)
|
||||
-- you can specify color or cterm_color instead of specifying both of them
|
||||
-- DevIcon will be appended to `name`
|
||||
|
@ -8,37 +8,37 @@ return function()
|
|||
icon = "",
|
||||
color = "#428850",
|
||||
cterm_color = "65",
|
||||
name = "Zsh"
|
||||
}
|
||||
};
|
||||
name = "Zsh",
|
||||
},
|
||||
},
|
||||
-- globally enable different highlight colors per icon (default to true)
|
||||
-- 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)
|
||||
-- will get overriden by `get_icons` option
|
||||
default = true;
|
||||
default = true,
|
||||
-- globally enable "strict" selection of icons - icon will be looked up in
|
||||
-- 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
|
||||
-- because its name happened to match some extension (default to false)
|
||||
strict = true;
|
||||
strict = true,
|
||||
-- same as `override` but specifically for overrides by filename
|
||||
-- takes effect when `strict` is true
|
||||
override_by_filename = {
|
||||
[".gitignore"] = {
|
||||
icon = "",
|
||||
color = "#f1502f",
|
||||
name = "Gitignore"
|
||||
}
|
||||
};
|
||||
name = "Gitignore",
|
||||
},
|
||||
},
|
||||
-- same as `override` but specifically for overrides by extension
|
||||
-- takes effect when `strict` is true
|
||||
override_by_extension = {
|
||||
["log"] = {
|
||||
icon = "",
|
||||
color = "#81e043",
|
||||
name = "Log"
|
||||
}
|
||||
};
|
||||
name = "Log",
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
return function()
|
||||
require('smart-splits').setup({
|
||||
require("smart-splits").setup {
|
||||
ignored_filetypes = {
|
||||
'nofile',
|
||||
'quickfix',
|
||||
'prompt',
|
||||
'neo-tree',
|
||||
"nofile",
|
||||
"quickfix",
|
||||
"prompt",
|
||||
"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 }
|
||||
|
||||
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_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_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_up, require("smart-splits").resize_up, option)
|
||||
vim.keymap.set({ "n", "t" }, keys.resize_right, require("smart-splits").resize_right, option)
|
||||
end
|
||||
|
|
|
@ -6,15 +6,15 @@ return {
|
|||
vim.g.alpha_statusline = false
|
||||
end,
|
||||
config = function()
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
local dashboard = require "alpha.themes.dashboard"
|
||||
|
||||
-- header, it's a logo
|
||||
dashboard.section.header.val = require("custom_opts").home_header
|
||||
dashboard.section.header.opts.hl = "HardHackerRed"
|
||||
|
||||
-- footer
|
||||
local handle = io.popen("fortune")
|
||||
local fortune = handle:read("*a")
|
||||
local handle = io.popen "fortune"
|
||||
local fortune = handle:read "*a"
|
||||
handle:close()
|
||||
dashboard.section.footer.val = fortune
|
||||
|
||||
|
@ -39,19 +39,19 @@ return {
|
|||
}
|
||||
|
||||
-- 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.opts.noautocmd = true
|
||||
|
||||
require("alpha").setup(dashboard.config)
|
||||
|
||||
-- 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 laststatus=0 | autocmd BufUnload <buffer> set laststatus=3
|
||||
autocmd User AlphaReady :NeoTreeClose
|
||||
autocmd User AlphaReady :AerialCloseAll
|
||||
]])
|
||||
]]
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -3,9 +3,9 @@ return {
|
|||
"akinsho/toggleterm.nvim",
|
||||
version = "*",
|
||||
config = function()
|
||||
local copts = require("custom_opts")
|
||||
local copts = require "custom_opts"
|
||||
|
||||
require("toggleterm").setup({
|
||||
require("toggleterm").setup {
|
||||
size = function(term)
|
||||
if term.direction == "horizontal" then
|
||||
return 15
|
||||
|
@ -34,12 +34,12 @@ return {
|
|||
border = "rounded",
|
||||
-- winblend = copts.window_transparency,
|
||||
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)
|
||||
return (w < 20) and 20 or w
|
||||
end,
|
||||
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))
|
||||
return (h < 35) and 35 or h
|
||||
end,
|
||||
|
@ -47,7 +47,7 @@ return {
|
|||
persist_size = true,
|
||||
persist_mode = true,
|
||||
autochdir = true,
|
||||
})
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ return {
|
|||
"mrjones2014/smart-splits.nvim",
|
||||
version = "v1.2.2",
|
||||
config = function()
|
||||
require("plugins/smart-split/config")()
|
||||
require "plugins/smart-split/config"()
|
||||
end,
|
||||
},
|
||||
|
||||
|
@ -18,10 +18,10 @@ return {
|
|||
"Shatur/neovim-session-manager",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
local Path = require("plenary.path")
|
||||
local config = require("session_manager.config")
|
||||
require("session_manager").setup({
|
||||
sessions_dir = Path:new(vim.fn.stdpath("data"), "sessions"), -- The directory where the session files will be saved.
|
||||
local Path = require "plenary.path"
|
||||
local config = require "session_manager.config"
|
||||
require("session_manager").setup {
|
||||
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.
|
||||
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
|
||||
|
@ -35,7 +35,7 @@ return {
|
|||
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.
|
||||
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
|
||||
local hardhacker_config_group = vim.api.nvim_create_augroup("HardHackerConfigGroup", {})
|
||||
|
@ -43,7 +43,7 @@ return {
|
|||
pattern = "SessionLoadPost",
|
||||
group = hardhacker_config_group,
|
||||
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,
|
||||
|
|
|
@ -9,10 +9,10 @@ return {
|
|||
"nvim-tree/nvim-web-devicons", -- optional dependency
|
||||
},
|
||||
config = function()
|
||||
require("barbecue").setup({
|
||||
require("barbecue").setup {
|
||||
create_autocmd = false, -- prevent barbecue from updating itself automatically
|
||||
theme = vim.g.hardhacker_barbecue_theme,
|
||||
})
|
||||
}
|
||||
|
||||
vim.api.nvim_create_autocmd({
|
||||
"WinScrolled", -- or WinResized on NVIM-v0.9 and higher
|
||||
|
@ -36,7 +36,7 @@ return {
|
|||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons", opt = true },
|
||||
config = function()
|
||||
require("plugins/lualine/config")()
|
||||
require "plugins/lualine/config"()
|
||||
end,
|
||||
},
|
||||
|
||||
|
@ -50,7 +50,7 @@ return {
|
|||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("plugins/neo-tree/config")()
|
||||
require "plugins/neo-tree/config"()
|
||||
end,
|
||||
},
|
||||
|
||||
|
@ -64,10 +64,10 @@ return {
|
|||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
config = function()
|
||||
require("aerial").setup({
|
||||
require("aerial").setup {
|
||||
lazy_load = false,
|
||||
open_automatic = require("custom_opts").auto_open_outline,
|
||||
})
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
|
@ -77,7 +77,7 @@ return {
|
|||
version = "v4.1.0",
|
||||
dependencies = "nvim-tree/nvim-web-devicons",
|
||||
config = function()
|
||||
require("plugins/bufferline/config")()
|
||||
require "plugins/bufferline/config"()
|
||||
end,
|
||||
},
|
||||
|
||||
|
@ -89,7 +89,7 @@ return {
|
|||
"rcarriga/nvim-notify",
|
||||
},
|
||||
config = function()
|
||||
require("plugins/noice/config")()
|
||||
require "plugins/noice/config"()
|
||||
end,
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue