added neovim
This commit is contained in:
5
modules/home-manager/neovim/nvim/lua/.luarc.json
Normal file
5
modules/home-manager/neovim/nvim/lua/.luarc.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"diagnostics.globals": [
|
||||
"vim"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
'windwp/nvim-autopairs',
|
||||
event = "InsertEnter",
|
||||
opts = {} -- this is equalent to setup({}) function
|
||||
}
|
||||
19
modules/home-manager/neovim/nvim/lua/plugins/catppuccin.lua
Normal file
19
modules/home-manager/neovim/nvim/lua/plugins/catppuccin.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
return {
|
||||
"catppuccin/nvim",
|
||||
name = "catppuccin",
|
||||
priority = 1000,
|
||||
opts = {
|
||||
integrations = {
|
||||
cmp = true,
|
||||
gitsigns = true,
|
||||
treesitter = true,
|
||||
fidget = true,
|
||||
harpoon = true,
|
||||
leap = true,
|
||||
mason = true,
|
||||
telescope = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
7
modules/home-manager/neovim/nvim/lua/plugins/comment.lua
Normal file
7
modules/home-manager/neovim/nvim/lua/plugins/comment.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
'numToStr/Comment.nvim',
|
||||
opts = {
|
||||
-- add any options here
|
||||
},
|
||||
lazy = false,
|
||||
}
|
||||
10
modules/home-manager/neovim/nvim/lua/plugins/fidget.lua
Normal file
10
modules/home-manager/neovim/nvim/lua/plugins/fidget.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
return {
|
||||
'j-hui/fidget.nvim',
|
||||
opts = {
|
||||
notification = {
|
||||
window = {
|
||||
winblend = 0,
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
"m4xshen/hardtime.nvim",
|
||||
dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim" },
|
||||
opts = {
|
||||
disabled_filetypes = {"qf", "netrw", "NvimTree", "lazy", "mason", "oil", "telescope"}
|
||||
}
|
||||
}
|
||||
9
modules/home-manager/neovim/nvim/lua/plugins/harpoon.lua
Normal file
9
modules/home-manager/neovim/nvim/lua/plugins/harpoon.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
'theprimeagen/harpoon',
|
||||
keys = {
|
||||
{ "<leader>a", function() require('harpoon.mark').add_file() end },
|
||||
{ "<leader>e", function() require('harpoon.ui').toggle_quick_menu() end },
|
||||
{ "<leader>k", function() require('harpoon.ui').nav_next() end },
|
||||
{ "<leader>j", function() require('harpoon.ui').nav_prev() end },
|
||||
}
|
||||
}
|
||||
41
modules/home-manager/neovim/nvim/lua/plugins/hawtkeys.lua
Normal file
41
modules/home-manager/neovim/nvim/lua/plugins/hawtkeys.lua
Normal file
@@ -0,0 +1,41 @@
|
||||
return {
|
||||
"tris203/hawtkeys.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = {
|
||||
leader = " ", -- the key you want to use as the leader, default is space
|
||||
homerow = 2, -- the row you want to use as the homerow, default is 2
|
||||
powerFingers = { 2, 3, 6, 7 }, -- the fingers you want to use as the powerfingers, default is {2,3,6,7}
|
||||
keyboardLayout = "qwerty", -- the keyboard layout you use, default is qwerty
|
||||
customMaps = {
|
||||
--- EG local map = vim.api
|
||||
--- map.nvim_set_keymap('n', '<leader>1', '<cmd>echo 1')
|
||||
{
|
||||
["map.nvim_set_keymap"] = { --name of the expression
|
||||
modeIndex = "1", -- the position of the mode setting
|
||||
lhsIndex = "2", -- the position of the lhs setting
|
||||
rhsIndex = "3", -- the position of the rhs setting
|
||||
optsIndex = "4", -- the position of the index table
|
||||
method = "dot_index_expression", -- if the function name contains a dot
|
||||
},
|
||||
},
|
||||
--- EG local map2 = vim.api.nvim_set_keymap
|
||||
["map2"] = { --name of the function
|
||||
modeIndex = 1, --if you use a custom function with a fixed value, eg normRemap, then this can be a fixed mode eg 'n'
|
||||
lhsIndex = 2,
|
||||
rhsIndex = 3,
|
||||
optsIndex = 4,
|
||||
method = "function_call",
|
||||
},
|
||||
-- If you use lazy.nvim's keys property to configure keymaps in your plugins
|
||||
["lazy"] = {
|
||||
method = "lazy",
|
||||
},
|
||||
},
|
||||
highlights = { -- these are the highlight used in search mode
|
||||
HawtkeysMatchGreat = { fg = "green", bold = true },
|
||||
HawtkeysMatchGood = { fg = "green"},
|
||||
HawtkeysMatchOk = { fg = "yellow" },
|
||||
HawtkeysMatchBad = { fg = "red" },
|
||||
},
|
||||
},
|
||||
}
|
||||
6
modules/home-manager/neovim/nvim/lua/plugins/leap.lua
Normal file
6
modules/home-manager/neovim/nvim/lua/plugins/leap.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
return {
|
||||
'ggandor/leap.nvim',
|
||||
config = function()
|
||||
require("leap").set_default_keymaps()
|
||||
end
|
||||
}
|
||||
81
modules/home-manager/neovim/nvim/lua/plugins/lsp.lua
Normal file
81
modules/home-manager/neovim/nvim/lua/plugins/lsp.lua
Normal file
@@ -0,0 +1,81 @@
|
||||
return {
|
||||
'VonHeikemen/lsp-zero.nvim',
|
||||
branch = 'v3.x',
|
||||
dependencies = {
|
||||
-- LSP Support
|
||||
{'neovim/nvim-lspconfig'}, -- Required
|
||||
{'williamboman/mason.nvim'}, -- Optional
|
||||
{'williamboman/mason-lspconfig.nvim'}, -- Optional
|
||||
|
||||
-- Autocompletion
|
||||
{'hrsh7th/nvim-cmp'}, -- Required
|
||||
{'hrsh7th/cmp-nvim-lsp'}, -- Required
|
||||
{'L3MON4D3/LuaSnip'}, -- Required
|
||||
{'saadparwaiz1/cmp_luasnip'},
|
||||
{'onsails/lspkind.nvim'} -- Optional
|
||||
},
|
||||
config = function()
|
||||
local lsp_zero = require('lsp-zero')
|
||||
|
||||
lsp_zero.on_attach(function(client, bufnr)
|
||||
local opts = {buffer = bufnr, remap = false}
|
||||
|
||||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
|
||||
vim.keymap.set("n", "gr", function() vim.lsp.buf.references() end, opts)
|
||||
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
|
||||
vim.keymap.set("n", "<leader>ws", function() vim.lsp.buf.workspace_symbol() end, opts)
|
||||
vim.keymap.set("n", "<leader>d", function() vim.diagnostic.open_float() end, opts)
|
||||
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
|
||||
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
|
||||
vim.keymap.set("n", "<leader>ca", function() vim.lsp.buf.code_action() end, opts)
|
||||
vim.keymap.set("n", "<leader>rn", function() vim.lsp.buf.rename() end, opts)
|
||||
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
|
||||
end)
|
||||
|
||||
-- Mason Config
|
||||
require('mason').setup({})
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = {},
|
||||
handlers = {
|
||||
lsp_zero.default_setup,
|
||||
}
|
||||
})
|
||||
|
||||
-- cmp Config
|
||||
|
||||
local cmp = require('cmp')
|
||||
local cmp_action = require('lsp-zero').cmp_action()
|
||||
|
||||
cmp.setup({
|
||||
sources = {
|
||||
{name = 'path'},
|
||||
{name = 'nvim_lsp'},
|
||||
{name = 'nvim_lua'},
|
||||
{name = 'luasnip'},
|
||||
{name = 'cmp_luasnip'},
|
||||
{name = 'buffer'},
|
||||
{name = 'neorg'}
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
formatting = {
|
||||
fields = {'abbr', 'kind', 'menu'},
|
||||
format = require('lspkind').cmp_format({
|
||||
mode = 'symbol', -- show only symbol annotations
|
||||
maxwidth = 50, -- prevent the popup from showing more than provided characters
|
||||
ellipsis_char = '...', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead
|
||||
})
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<CR>'] = cmp.mapping.confirm({select = false}),
|
||||
-- scroll up and down the documentation window
|
||||
['<C-u>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(4),
|
||||
-- ['<Tab>'] = cmp_action.luasnip_supertab(),
|
||||
-- ['<S-Tab>'] = cmp_action.luasnip_shift_supertab(),
|
||||
}),
|
||||
})
|
||||
end,
|
||||
}
|
||||
12
modules/home-manager/neovim/nvim/lua/plugins/luasnip.lua
Normal file
12
modules/home-manager/neovim/nvim/lua/plugins/luasnip.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
return {
|
||||
"L3MON4D3/LuaSnip",
|
||||
dependencies = { "rafamadriz/friendly-snippets" },
|
||||
-- follow latest release.
|
||||
version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
|
||||
-- install jsregexp (optional!).
|
||||
build = "make install_jsregexp",
|
||||
config = function ()
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
end
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
return {
|
||||
"christoomey/vim-tmux-navigator",
|
||||
cmd = {
|
||||
"TmuxNavigateLeft",
|
||||
"TmuxNavigateDown",
|
||||
"TmuxNavigateUp",
|
||||
"TmuxNavigateRight",
|
||||
"TmuxNavigatePrevious",
|
||||
},
|
||||
keys = {
|
||||
{ "<c-h>", "<cmd><C-U>TmuxNavigateLeft<cr>" },
|
||||
{ "<c-j>", "<cmd><C-U>TmuxNavigateDown<cr>" },
|
||||
{ "<c-k>", "<cmd><C-U>TmuxNavigateUp<cr>" },
|
||||
{ "<c-l>", "<cmd><C-U>TmuxNavigateRight<cr>" },
|
||||
{ "<c-\\>", "<cmd><C-U>TmuxNavigatePrevious<cr>" },
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
'windwp/nvim-ts-autotag',
|
||||
}
|
||||
22
modules/home-manager/neovim/nvim/lua/plugins/pets.lua
Normal file
22
modules/home-manager/neovim/nvim/lua/plugins/pets.lua
Normal file
@@ -0,0 +1,22 @@
|
||||
return {
|
||||
"giusgad/pets.nvim",
|
||||
dependencies = { "MunifTanjim/nui.nvim", "giusgad/hologram.nvim" },
|
||||
config = function ()
|
||||
require("pets").setup({
|
||||
row = 1, -- the row (height) to display the pet at (higher row means the pet is lower on the screen), must be 1<=row<=10
|
||||
col = 0, -- the column to display the pet at (set to high number to have it stay still on the right side)
|
||||
speed_multiplier = 1, -- you can make your pet move faster/slower. If slower the animation will have lower fps.
|
||||
default_pet = "dog", -- the pet to use for the PetNew command
|
||||
default_style = "brown", -- the style of the pet to use for the PetNew command
|
||||
random = true, -- whether to use a random pet for the PetNew command, overrides default_pet and default_style
|
||||
death_animation = true, -- animate the pet's death, set to false to feel less guilt -- currently no animations are available
|
||||
popup = { -- popup options, try changing these if you see a rectangle around the pets
|
||||
width = "30%", -- can be a string with percentage like "45%" or a number of columns like 45
|
||||
winblend = 100, -- winblend value - see :h 'winblend' - only used if avoid_statusline is false
|
||||
hl = { Normal = "Normal" }, -- hl is only set if avoid_statusline is true, you can put any hl group instead of "Normal"
|
||||
avoid_statusline = true, -- if winblend is 100 then the popup is invisible and covers the statusline, if that
|
||||
-- doesn't work for you then set this to true and the popup will use hl and will be spawned above the statusline (hopefully)
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
||||
54
modules/home-manager/neovim/nvim/lua/plugins/rest.lua
Normal file
54
modules/home-manager/neovim/nvim/lua/plugins/rest.lua
Normal file
@@ -0,0 +1,54 @@
|
||||
return {
|
||||
"rest-nvim/rest.nvim",
|
||||
dependencies = { { "nvim-lua/plenary.nvim" } },
|
||||
config = function()
|
||||
require("rest-nvim").setup({
|
||||
-- Open request results in a horizontal split
|
||||
result_split_horizontal = false,
|
||||
-- Keep the http file buffer above|left when split horizontal|vertical
|
||||
result_split_in_place = false,
|
||||
-- stay in current windows (.http file) or change to results window (default)
|
||||
stay_in_current_window_after_split = false,
|
||||
-- Skip SSL verification, useful for unknown certificates
|
||||
skip_ssl_verification = false,
|
||||
-- Encode URL before making request
|
||||
encode_url = true,
|
||||
-- Highlight request on run
|
||||
highlight = {
|
||||
enabled = true,
|
||||
timeout = 150,
|
||||
},
|
||||
result = {
|
||||
-- toggle showing URL, HTTP info, headers at top the of result window
|
||||
show_url = true,
|
||||
-- show the generated curl command in case you want to launch
|
||||
-- the same request via the terminal (can be verbose)
|
||||
show_curl_command = false,
|
||||
show_http_info = true,
|
||||
show_headers = true,
|
||||
-- table of curl `--write-out` variables or false if disabled
|
||||
-- for more granular control see Statistics Spec
|
||||
show_statistics = false,
|
||||
-- executables or functions for formatting response body [optional]
|
||||
-- set them to false if you want to disable them
|
||||
formatters = {
|
||||
json = "jq",
|
||||
html = function(body)
|
||||
return vim.fn.system({"tidy", "-i", "-q", "-"}, body)
|
||||
end
|
||||
},
|
||||
},
|
||||
-- Jump to request line on run
|
||||
jump_to_request = false,
|
||||
env_file = '.env',
|
||||
-- for telescope select
|
||||
env_pattern = "\\.env$",
|
||||
env_edit_command = "tabedit",
|
||||
custom_dynamic_variables = {},
|
||||
yank_dry_run = true,
|
||||
search_back = true,
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>r", "<Plug>RestNvim")
|
||||
end
|
||||
}
|
||||
10
modules/home-manager/neovim/nvim/lua/plugins/surround.lua
Normal file
10
modules/home-manager/neovim/nvim/lua/plugins/surround.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
return {
|
||||
"kylechui/nvim-surround",
|
||||
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("nvim-surround").setup({
|
||||
-- Configuration here, or leave empty to use defaults
|
||||
})
|
||||
end
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
build = 'make'
|
||||
}
|
||||
29
modules/home-manager/neovim/nvim/lua/plugins/telescope.lua
Normal file
29
modules/home-manager/neovim/nvim/lua/plugins/telescope.lua
Normal file
@@ -0,0 +1,29 @@
|
||||
return {
|
||||
{
|
||||
'nvim-telescope/telescope-ui-select.nvim'
|
||||
},
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
dependencies = {'nvim-lua/plenary.nvim'},
|
||||
lazy = false,
|
||||
keys = {
|
||||
{ "<leader>ff", "<cmd>Telescope find_files<cr>" },
|
||||
{ "<leader>fb", "<cmd>Telescope buffers<cr>" },
|
||||
{ "<leader>fo", "<cmd>Telescope oldfiles<cr>" },
|
||||
{ "<leader>fg", "<cmd>Telescope live_grep<cr>" },
|
||||
{ "<leader>fc", "<cmd>Telescope commands<cr>" }
|
||||
},
|
||||
config = function()
|
||||
require("telescope").setup {
|
||||
extensions = {
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-- require('telescope').load_extension('fzf')
|
||||
require("telescope").load_extension("ui-select")
|
||||
end
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
'xiyaowong/transparent.nvim'
|
||||
}
|
||||
79
modules/home-manager/neovim/nvim/lua/plugins/treesitter.lua
Normal file
79
modules/home-manager/neovim/nvim/lua/plugins/treesitter.lua
Normal file
@@ -0,0 +1,79 @@
|
||||
return {
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
config = function()
|
||||
require('nvim-treesitter.configs').setup({
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
auto_install = true,
|
||||
|
||||
-- indent module
|
||||
indent = { enable = true },
|
||||
|
||||
-- highlight module
|
||||
highlight = { enable = true },
|
||||
|
||||
-- auto close tags in html/jsx/tsx
|
||||
autotag = { enable = true },
|
||||
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = '<CR>',
|
||||
scope_incremental = '<CR>',
|
||||
node_incremental = '<TAB>',
|
||||
node_decremental = '<S-TAB>',
|
||||
},
|
||||
},
|
||||
|
||||
-- text object selection
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
|
||||
-- Automatically jump forward to textobj, similar to targets.vim
|
||||
lookahead = true,
|
||||
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
-- You can also use captures from other query groups like `locals.scm`
|
||||
["as"] = { query = "@scope", query_group = "locals", desc = "Select language scope" },
|
||||
},
|
||||
-- You can choose the select mode (default is charwise 'v')
|
||||
--
|
||||
-- Can also be a function which gets passed a table with the keys
|
||||
-- * query_string: eg '@function.inner'
|
||||
-- * method: eg 'v' or 'o'
|
||||
-- and should return the mode ('v', 'V', or '<c-v>') or a table
|
||||
-- mapping query_strings to modes.
|
||||
selection_modes = {
|
||||
['@parameter.outer'] = 'v', -- charwise
|
||||
['@function.outer'] = 'V', -- linewise
|
||||
['@class.outer'] = '<c-v>', -- blockwise
|
||||
},
|
||||
-- If you set this to `true` (default is `false`) then any textobject is
|
||||
-- extended to include preceding or succeeding whitespace. Succeeding
|
||||
-- whitespace has priority in order to act similarly to eg the built-in
|
||||
-- `ap`.
|
||||
--
|
||||
-- Can also be a function which gets passed a table with the keys
|
||||
-- * query_string: eg '@function.inner'
|
||||
-- * selection_mode: eg 'v'
|
||||
-- and should return true of false
|
||||
include_surrounding_whitespace = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
end
|
||||
},
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter-textobjects'
|
||||
},
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
return {
|
||||
'mbbill/undotree',
|
||||
keys = {
|
||||
{ "<leader>u", vim.cmd.UndotreeToggle, desc = "Undotree" },
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
return { 'nvim-tree/nvim-web-devicons' }
|
||||
Reference in New Issue
Block a user