Skip to content

Commit ebd68fb

Browse files
committed
move
1 parent f86f18f commit ebd68fb

File tree

16 files changed

+662
-808
lines changed

16 files changed

+662
-808
lines changed

.stylua.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ column_width = 160
22
line_endings = "Unix"
33
indent_type = "Spaces"
44
indent_width = 2
5-
quote_style = "AutoPreferSingle"
6-
call_parentheses = "None"
5+
quote_style = "AutoPreferDouble"

doc/kickstart.txt

Lines changed: 0 additions & 24 deletions
This file was deleted.

doc/tags

Lines changed: 0 additions & 3 deletions
This file was deleted.

init.lua

Lines changed: 35 additions & 722 deletions
Large diffs are not rendered by default.
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
return { -- Autocompletion
2+
"hrsh7th/nvim-cmp",
3+
event = "InsertEnter",
4+
dependencies = {
5+
-- Snippet Engine & its associated nvim-cmp source
6+
{
7+
"L3MON4D3/LuaSnip",
8+
build = (function()
9+
-- Build Step is needed for regex support in snippets.
10+
-- This step is not supported in many windows environments.
11+
-- Remove the below condition to re-enable on windows.
12+
if vim.fn.has("win32") == 1 or vim.fn.executable("make") == 0 then
13+
return
14+
end
15+
return "make install_jsregexp"
16+
end)(),
17+
dependencies = {
18+
-- `friendly-snippets` contains a variety of premade snippets.
19+
-- See the README about individual language/framework/plugin snippets:
20+
-- https://github.com/rafamadriz/friendly-snippets
21+
-- {
22+
-- 'rafamadriz/friendly-snippets',
23+
-- config = function()
24+
-- require('luasnip.loaders.from_vscode').lazy_load()
25+
-- end,
26+
-- },
27+
},
28+
},
29+
"saadparwaiz1/cmp_luasnip",
30+
31+
-- Adds other completion capabilities.
32+
-- nvim-cmp does not ship with all sources by default. They are split
33+
-- into multiple repos for maintenance purposes.
34+
"hrsh7th/cmp-nvim-lsp",
35+
"hrsh7th/cmp-path",
36+
},
37+
config = function()
38+
-- See `:help cmp`
39+
local cmp = require("cmp")
40+
local luasnip = require("luasnip")
41+
luasnip.config.setup({})
42+
43+
cmp.setup({
44+
snippet = {
45+
expand = function(args)
46+
luasnip.lsp_expand(args.body)
47+
end,
48+
},
49+
completion = { completeopt = "menu,menuone,noinsert" },
50+
51+
-- For an understanding of why these mappings were
52+
-- chosen, you will need to read `:help ins-completion`
53+
--
54+
-- No, but seriously. Please read `:help ins-completion`, it is really good!
55+
mapping = cmp.mapping.preset.insert({
56+
-- Select the [n]ext item
57+
["<C-n>"] = cmp.mapping.select_next_item(),
58+
-- Select the [p]revious item
59+
["<C-p>"] = cmp.mapping.select_prev_item(),
60+
61+
-- Scroll the documentation window [b]ack / [f]orward
62+
["<C-b>"] = cmp.mapping.scroll_docs(-4),
63+
["<C-f>"] = cmp.mapping.scroll_docs(4),
64+
65+
-- Accept ([y]es) the completion.
66+
-- This will auto-import if your LSP supports it.
67+
-- This will expand snippets if the LSP sent a snippet.
68+
["<C-y>"] = cmp.mapping.confirm({ select = true }),
69+
70+
-- If you prefer more traditional completion keymaps,
71+
-- you can uncomment the following lines
72+
--['<CR>'] = cmp.mapping.confirm { select = true },
73+
--['<Tab>'] = cmp.mapping.select_next_item(),
74+
--['<S-Tab>'] = cmp.mapping.select_prev_item(),
75+
76+
-- Manually trigger a completion from nvim-cmp.
77+
-- Generally you don't need this, because nvim-cmp will display
78+
-- completions whenever it has completion options available.
79+
["<C-Space>"] = cmp.mapping.complete({}),
80+
81+
-- Think of <c-l> as moving to the right of your snippet expansion.
82+
-- So if you have a snippet that's like:
83+
-- function $name($args)
84+
-- $body
85+
-- end
86+
--
87+
-- <c-l> will move you to the right of each of the expansion locations.
88+
-- <c-h> is similar, except moving you backwards.
89+
["<C-l>"] = cmp.mapping(function()
90+
if luasnip.expand_or_locally_jumpable() then
91+
luasnip.expand_or_jump()
92+
end
93+
end, { "i", "s" }),
94+
["<C-h>"] = cmp.mapping(function()
95+
if luasnip.locally_jumpable(-1) then
96+
luasnip.jump(-1)
97+
end
98+
end, { "i", "s" }),
99+
100+
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
101+
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
102+
}),
103+
sources = {
104+
{ name = "nvim_lsp" },
105+
{ name = "luasnip" },
106+
{ name = "path" },
107+
},
108+
})
109+
end,
110+
}

lua/custom/plugins/colorscheme.lua

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
return {
2+
"catppuccin/nvim",
3+
name = "catppuccin",
4+
config = function()
5+
require("catppuccin").setup({
6+
flavour = "mocha",
7+
priority = 1000,
8+
lazy = true,
9+
transparent_background = true,
10+
custom_highlights = function()
11+
return {
12+
Comment = { fg = "#d4922F" },
13+
}
14+
end,
15+
})
16+
end,
17+
init = function()
18+
vim.cmd.colorscheme("catppuccin")
19+
end,
20+
}

lua/custom/plugins/folke.lua

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
-- NOTE: Plugins can also be configured to run Lua code when they are loaded.
2+
--
3+
-- This is often very useful to both group configuration, as well as handle
4+
-- lazy loading plugins that don't need to be loaded immediately at startup.
5+
--
6+
-- For example, in the following configuration, we use:
7+
-- event = 'VimEnter'
8+
--
9+
-- which loads which-key before all the UI elements are loaded. Events can be
10+
-- normal autocommands events (`:help autocmd-events`).
11+
--
12+
-- Then, because we use the `config` key, the configuration only runs
13+
-- after the plugin has been loaded:
14+
-- config = function() ... end
15+
16+
return { -- Useful plugin to show you pending keybinds.
17+
"folke/which-key.nvim",
18+
event = "VimEnter", -- Sets the loading event to 'VimEnter'
19+
config = function() -- This is the function that runs, AFTER loading
20+
require("which-key").setup()
21+
22+
-- Document existing key chains
23+
require("which-key").register({
24+
["<leader>c"] = { name = "[C]ode", _ = "which_key_ignore" },
25+
["<leader>d"] = { name = "[D]ocument", _ = "which_key_ignore" },
26+
["<leader>r"] = { name = "[R]ename", _ = "which_key_ignore" },
27+
["<leader>s"] = { name = "[S]earch", _ = "which_key_ignore" },
28+
["<leader>w"] = { name = "[W]orkspace", _ = "which_key_ignore" },
29+
["<leader>t"] = { name = "[T]oggle", _ = "which_key_ignore" },
30+
["<leader>h"] = { name = "Git [H]unk", _ = "which_key_ignore" },
31+
})
32+
-- visual mode
33+
require("which-key").register({
34+
["<leader>h"] = { "Git [H]unk" },
35+
}, { mode = "v" })
36+
end,
37+
}

lua/custom/plugins/format.lua

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
return { -- Autoformat
2+
"stevearc/conform.nvim",
3+
lazy = false,
4+
keys = {
5+
{
6+
"<leader>f",
7+
function()
8+
require("conform").format({ async = true, lsp_fallback = true })
9+
end,
10+
mode = "",
11+
desc = "[F]ormat buffer",
12+
},
13+
},
14+
opts = {
15+
notify_on_error = false,
16+
format_on_save = function(bufnr)
17+
-- Disable "format_on_save lsp_fallback" for languages that don't
18+
-- have a well standardized coding style. You can add additional
19+
-- languages here or re-enable it for the disabled ones.
20+
local disable_filetypes = { c = true, cpp = true }
21+
return {
22+
timeout_ms = 500,
23+
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
24+
}
25+
end,
26+
formatters_by_ft = {
27+
lua = { "stylua" },
28+
-- Conform can also run multiple formatters sequentially
29+
-- python = { "isort", "black" },
30+
--
31+
-- You can use a sub-list to tell conform to run *until* a formatter
32+
-- is found.
33+
-- javascript = { { "prettierd", "prettier" } },
34+
},
35+
},
36+
}

lua/custom/plugins/git.lua

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
-- See `:help gitsigns` to understand what the configuration keys do
2+
return { -- Adds git related signs to the gutter, as well as utilities for managing changes
3+
"lewis6991/gitsigns.nvim",
4+
opts = {
5+
signs = {
6+
add = { text = "+" },
7+
change = { text = "~" },
8+
delete = { text = "_" },
9+
topdelete = { text = "" },
10+
changedelete = { text = "~" },
11+
},
12+
},
13+
}

lua/custom/plugins/init.lua

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
-- You can add your own plugins here or in other files in this directory!
2-
-- I promise not to create any merge conflicts in this directory :)
3-
--
4-
-- See the kickstart.nvim README for more information
5-
return {}
1+
return {
2+
"tpope/vim-sleuth", -- Detect tabstop and shiftwidth automatically
3+
{ "numToStr/Comment.nvim", opts = {} }, -- "gc" to comment visual regions/lines
4+
-- Highlight todo, notes, etc in comments
5+
{ "folke/todo-comments.nvim", event = "VimEnter", dependencies = { "nvim-lua/plenary.nvim" }, opts = { signs = false } },
6+
}

0 commit comments

Comments
 (0)