Compare commits
No commits in common. "9ad4462e8c3849e16e2313197d932f0b7508873b" and "9f07874772ac8dcda500be227c87d6d93ab01dde" have entirely different histories.
9ad4462e8c
...
9f07874772
2
init.lua
2
init.lua
|
@ -5,9 +5,9 @@ local vanila_vim_autostart_commands = {
|
||||||
"set shiftwidth=4",
|
"set shiftwidth=4",
|
||||||
"set tabstop=4",
|
"set tabstop=4",
|
||||||
"set ttyfast",
|
"set ttyfast",
|
||||||
|
"set clipboard=unnamedplus"
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.o.showcmdloc = "statusline"
|
|
||||||
vim.diagnostic.config({
|
vim.diagnostic.config({
|
||||||
virtual_text = true,
|
virtual_text = true,
|
||||||
signs = {
|
signs = {
|
||||||
|
|
|
@ -31,6 +31,11 @@ local kind_icons = {
|
||||||
cmp.setup {
|
cmp.setup {
|
||||||
completion = { completeopt = "menu,menuone" },
|
completion = { completeopt = "menu,menuone" },
|
||||||
|
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
require("luasnip").lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
window = {
|
window = {
|
||||||
completion = {
|
completion = {
|
||||||
-- winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None",
|
-- winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None",
|
||||||
|
@ -67,6 +72,8 @@ cmp.setup {
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item()
|
cmp.select_next_item()
|
||||||
|
elseif require("luasnip").expand_or_jumpable() then
|
||||||
|
require("luasnip").expand_or_jump()
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
|
@ -75,6 +82,8 @@ cmp.setup {
|
||||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_prev_item()
|
cmp.select_prev_item()
|
||||||
|
elseif require("luasnip").jumpable(-1) then
|
||||||
|
require("luasnip").jump(-1)
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
|
@ -83,6 +92,7 @@ cmp.setup {
|
||||||
|
|
||||||
sources = {
|
sources = {
|
||||||
{ name = "nvim_lsp" },
|
{ name = "nvim_lsp" },
|
||||||
|
{ name = "luasnip" },
|
||||||
{ name = "buffer" },
|
{ name = "buffer" },
|
||||||
{ name = "path" },
|
{ name = "path" },
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
eslint.setup({
|
|
||||||
bin = 'eslint', -- or `eslint_d`
|
|
||||||
code_actions = {
|
|
||||||
enable = true,
|
|
||||||
apply_on_save = {
|
|
||||||
enable = true,
|
|
||||||
types = { "directive", "problem", "suggestion", "layout" },
|
|
||||||
},
|
|
||||||
disable_rule_comment = {
|
|
||||||
enable = true,
|
|
||||||
location = "separate_line", -- or `same_line`
|
|
||||||
},
|
|
||||||
},
|
|
||||||
diagnostics = {
|
|
||||||
enable = true,
|
|
||||||
report_unused_disable_directives = false,
|
|
||||||
run_on = "type", -- or `save`
|
|
||||||
},
|
|
||||||
})
|
|
|
@ -28,26 +28,30 @@ lspconfig.eslint.setup({
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.enable('tailwindcss')
|
|
||||||
|
|
||||||
lspconfig.tailwindcss.setup({})
|
|
||||||
|
|
||||||
lspconfig.ts_ls.setup({
|
lspconfig.ts_ls.setup({
|
||||||
settings = {
|
settings = {
|
||||||
typescript = {
|
typescript = {
|
||||||
inlayHints = {
|
inlayHints = {
|
||||||
includeInlayParameterNameHints = "all", -- 'none' | 'literals' | 'all'
|
includeInlayParameterNameHints = "all", -- 'none' | 'literals' | 'all'
|
||||||
|
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
|
||||||
includeInlayFunctionParameterTypeHints = true,
|
includeInlayFunctionParameterTypeHints = true,
|
||||||
includeInlayVariableTypeHints = true,
|
includeInlayVariableTypeHints = true,
|
||||||
|
includeInlayVariableTypeHintsWhenTypeMatchesName = false,
|
||||||
includeInlayPropertyDeclarationTypeHints = true,
|
includeInlayPropertyDeclarationTypeHints = true,
|
||||||
|
includeInlayFunctionLikeReturnTypeHints = true,
|
||||||
|
includeInlayEnumMemberValueHints = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
javascript = {
|
javascript = {
|
||||||
inlayHints = {
|
inlayHints = {
|
||||||
includeInlayParameterNameHints = "all", -- 'none' | 'literals' | 'all'
|
includeInlayParameterNameHints = "all", -- 'none' | 'literals' | 'all'
|
||||||
includeInlayFunctionParameterTypeHints = true,
|
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
|
||||||
includeInlayVariableTypeHints = true,
|
includeInlayVariableTypeHints = true,
|
||||||
|
includeInlayFunctionParameterTypeHints = true,
|
||||||
|
includeInlayVariableTypeHintsWhenTypeMatchesName = false,
|
||||||
includeInlayPropertyDeclarationTypeHints = true,
|
includeInlayPropertyDeclarationTypeHints = true,
|
||||||
|
includeInlayFunctionLikeReturnTypeHints = true,
|
||||||
|
includeInlayEnumMemberValueHints = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ require("lualine").setup({
|
||||||
source = nil, -- A function that works as a data source for diff.
|
source = nil, -- A function that works as a data source for diff.
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
lualine_x = { '%S', 'encoding', 'filetype',
|
lualine_x = { 'encoding', 'filetype',
|
||||||
{
|
{
|
||||||
'diagnostics',
|
'diagnostics',
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
-- vscode format
|
||||||
|
require("luasnip.loaders.from_vscode").lazy_load { exclude = vim.g.vscode_snippets_exclude or {} }
|
||||||
|
require("luasnip.loaders.from_vscode").lazy_load { paths = vim.g.vscode_snippets_path or "" }
|
||||||
|
|
||||||
|
-- snipmate format
|
||||||
|
require("luasnip.loaders.from_snipmate").load()
|
||||||
|
require("luasnip.loaders.from_snipmate").lazy_load { paths = vim.g.snipmate_snippets_path or "" }
|
||||||
|
|
||||||
|
-- lua format
|
||||||
|
require("luasnip.loaders.from_lua").load()
|
||||||
|
require("luasnip.loaders.from_lua").lazy_load { paths = vim.g.lua_snippets_path or "" }
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("InsertLeave", {
|
||||||
|
callback = function()
|
||||||
|
if
|
||||||
|
require("luasnip").session.current_nodes[vim.api.nvim_get_current_buf()]
|
||||||
|
and not require("luasnip").session.jump_active
|
||||||
|
then
|
||||||
|
require("luasnip").unlink_current()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
|
@ -16,6 +16,12 @@ vim.g.rustaceanvim = {
|
||||||
command = "clippy",
|
command = "clippy",
|
||||||
allFeatures = true
|
allFeatures = true
|
||||||
},
|
},
|
||||||
|
inlayHints = {
|
||||||
|
lifetimeElisionHints = {
|
||||||
|
enable = true,
|
||||||
|
useParameterNames = true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,8 @@ map("i", "<C-s>", "<cmd>w!<cr>")
|
||||||
|
|
||||||
map("n", "<C-f>", "<C-q>")
|
map("n", "<C-f>", "<C-q>")
|
||||||
map("i", "<C-f>", "<C-q>")
|
map("i", "<C-f>", "<C-q>")
|
||||||
|
map("n", "<", "<cmd><gv<cr>")
|
||||||
|
map("n", ">", "<cmd>>gv<cr>")
|
||||||
|
|
||||||
map("n", "<leader>c", function(bufnr)
|
map("n", "<leader>c", function(bufnr)
|
||||||
bl_utils.buf_kill("bd", bufnr, true)
|
bl_utils.buf_kill("bd", bufnr, true)
|
||||||
|
@ -51,11 +53,8 @@ end, { desc = "Toggle DAP ui" })
|
||||||
|
|
||||||
map("n", "<A-j>", "<cmd>m .+1<CR>==")
|
map("n", "<A-j>", "<cmd>m .+1<CR>==")
|
||||||
map("n", "<A-k>", "<cmd>m .-2<CR>==")
|
map("n", "<A-k>", "<cmd>m .-2<CR>==")
|
||||||
map("i", "<A-j>", "<Esc><cmd>m .+1<CR>==gi<cr>")
|
map("i", "<A-j>", "<Esc><cmd>m .+1<CR>==gi")
|
||||||
map("i", "<A-k>", "<Esc><cmd>m .-2<CR>==gi<cr>")
|
map("i", "<A-k>", "<Esc><cmd>m .-2<CR>==gi")
|
||||||
|
|
||||||
map("v", "<Tab>", ">gv")
|
|
||||||
map("v", "<S-Tab>", "<gv")
|
|
||||||
|
|
||||||
map("n", "<C-Up>", "<cmd>resize -2<CR>")
|
map("n", "<C-Up>", "<cmd>resize -2<CR>")
|
||||||
map("n", "<C-Down>", "<cmd>resize +2<CR>")
|
map("n", "<C-Down>", "<cmd>resize +2<CR>")
|
||||||
|
|
|
@ -113,6 +113,16 @@ return {
|
||||||
event = "InsertEnter",
|
event = "InsertEnter",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{
|
{
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
|
dependencies = "rafamadriz/friendly-snippets",
|
||||||
|
opts = { history = true, updateevents = "TextChanged,TextChangedI" },
|
||||||
|
config = function(_, opts)
|
||||||
|
require("luasnip").config.set_config(opts)
|
||||||
|
require "config.plugins.luasnip"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"saadparwaiz1/cmp_luasnip",
|
||||||
"hrsh7th/cmp-nvim-lua",
|
"hrsh7th/cmp-nvim-lua",
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
"hrsh7th/cmp-buffer",
|
"hrsh7th/cmp-buffer",
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
return {
|
return {
|
||||||
{
|
|
||||||
'Mofiqul/vscode.nvim',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kaarmu/typst.vim",
|
"kaarmu/typst.vim",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
|
@ -10,10 +7,6 @@ return {
|
||||||
'MunifTanjim/prettier.nvim',
|
'MunifTanjim/prettier.nvim',
|
||||||
lazy = true,
|
lazy = true,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
'MunifTanjim/eslint.nvim',
|
|
||||||
lazy = true,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
'akinsho/toggleterm.nvim', version = "*", config = true
|
'akinsho/toggleterm.nvim', version = "*", config = true
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue