Skip to content

Commit 810ab85

Browse files
committed
add v3
1 parent b53e8d1 commit 810ab85

14 files changed

+908
-380
lines changed

after_/plugin/bufferline.rc.lua

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--[[
2+
bufferline.rc.lua
3+
--]]
4+
5+
local status, bufferline = pcall(require, "bufferline")
6+
if (not status) then
7+
return
8+
end
9+
10+
bufferline.setup({
11+
options = {
12+
numbers = "ordinal",
13+
show_buffer_icons = false,
14+
show_buffer_close_icons = false,
15+
show_close_icon = false,
16+
}
17+
})

after_/plugin/gitsigns.rc.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--[[
2+
gitsigns.rc.lua
3+
--]]
4+
5+
local status, gitsigns = pcall(require, "gitsigns")
6+
if (not status) then
7+
return
8+
end
9+
10+
gitsigns.setup {}

after_/plugin/lspconfig.rc.lua

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
--[[
2+
lspconfig.rc.lua
3+
--]]
4+
5+
local status_util, util = pcall(require, "lspconfig/util")
6+
if (not status_util) then
7+
return
8+
end
9+
10+
local status_mason_lspconfig, mason_lspconfig = pcall(require, "mason-lspconfig")
11+
if (not status_mason_lspconfig) then
12+
return
13+
end
14+
15+
local status_lspconfig, lspconfig = pcall(require, "lspconfig")
16+
if (not status_lspconfig) then
17+
return
18+
end
19+
20+
mason_lspconfig.setup {
21+
ensure_installed = {
22+
"sumneko_lua",
23+
"tsserver",
24+
}
25+
}
26+
27+
-- See: https://github.com/neovim/nvim-lspconfig#suggested-configuration
28+
-- local opts = { noremap = true, silent = true }
29+
-- vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float, opts)
30+
-- vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts)
31+
-- vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
32+
-- vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, opts)
33+
34+
-- lua
35+
lspconfig.sumneko_lua.setup {
36+
settings = {
37+
Lua = {
38+
runtime = {
39+
version = "LuaJIT",
40+
},
41+
diagnostics = {
42+
globals = { "vim" },
43+
},
44+
workspace = {
45+
library = vim.api.nvim_get_runtime_file("", true),
46+
},
47+
telemetry = {
48+
enable = false,
49+
},
50+
},
51+
},
52+
}
53+
54+
-- typescript
55+
lspconfig.tsserver.setup {
56+
-- See: https://www.reddit.com/r/neovim/comments/px8ast/comment/heltpty
57+
root_dir = function(fname)
58+
return util.root_pattern("tsconfig.json")(fname)
59+
or util.root_pattern("package.json", "jsconfig.json", ".git")(fname)
60+
or util.path.dirname(fname)
61+
end
62+
}
63+
64+
-- configure diagnostics
65+
vim.diagnostic.config {
66+
severity_sort = true,
67+
update_in_insert = true,
68+
}
69+
70+
vim.fn.sign_define("DiagnosticSignError", {text = "", texthl = "DiagnosticSignError"})
71+
vim.fn.sign_define("DiagnosticSignWarn", {text = "", texthl = "DiagnosticSignWarn"})
72+
vim.fn.sign_define("DiagnosticSignInfo", {text = "", texthl = "DiagnosticSignInfo"})
73+
vim.fn.sign_define("DiagnosticSignHint", {text = "", texthl = "DiagnosticSignHint"})

after_/plugin/lualine.rc.lua

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
--[[
2+
lualine.rc.lua
3+
--]]
4+
5+
local status, lualine = pcall(require, "lualine")
6+
if (not status) then
7+
return
8+
end
9+
10+
lualine.setup({
11+
options = {
12+
icons_enabled = false,
13+
theme = "gruvbox",
14+
component_separators = "·",
15+
section_separators = "",
16+
},
17+
sections = {
18+
lualine_a = { "mode" },
19+
lualine_b = { "branch" },
20+
lualine_c = {
21+
-- https://github.com/nvim-lualine/lualine.nvim#filename-component-options
22+
{
23+
"filename",
24+
-- displays file status (readonly, modified, …)
25+
file_status = true,
26+
-- displays just filename (1 = relative, 2 = absolute path)
27+
path = 0,
28+
}
29+
},
30+
lualine_x = {
31+
-- https://github.com/nvim-lualine/lualine.nvim#diagnostics-component-options
32+
{
33+
"diagnostics",
34+
sources = {
35+
"nvim_diagnostic"
36+
},
37+
symbols = {
38+
error = "",
39+
warn = "",
40+
info = "",
41+
hint = ""
42+
},
43+
severity_sort = true,
44+
update_in_insert = true,
45+
},
46+
"encoding",
47+
"filetype"
48+
},
49+
lualine_y = { "progress" },
50+
lualine_z = { "location" }
51+
},
52+
inactive_sections = {
53+
lualine_a = {},
54+
lualine_b = {},
55+
lualine_c = {
56+
-- https://github.com/nvim-lualine/lualine.nvim#filename-component-options
57+
{
58+
"filename",
59+
-- displays file status (readonly, modified, …)
60+
file_status = true,
61+
-- displays relative path (0 = just filename, 2 = absolute path)
62+
path = 1
63+
}
64+
},
65+
lualine_x = { "location" },
66+
lualine_y = {},
67+
lualine_z = {}
68+
},
69+
tabline = {},
70+
-- TODO: check if this works
71+
extensions = { "fugitive" }
72+
})
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--[[
2+
mason-tool-installer.rc.lua
3+
--]]
4+
5+
local status, mason_tool_installer = pcall(require, "mason-tool-installer")
6+
if (not status) then
7+
return
8+
end
9+
10+
mason_tool_installer.setup {
11+
ensure_installed = {
12+
"eslint_d",
13+
"prettierd",
14+
}
15+
}

after_/plugin/mason.rc.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--[[
2+
mason.rc.lua
3+
--]]
4+
5+
local status, mason = pcall(require, "mason")
6+
if (not status) then
7+
return
8+
end
9+
10+
mason.setup()

after_/plugin/null-ls.rc.lua

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--[[
2+
null-ls.rc.lua
3+
--]]
4+
5+
local status, null_ls = pcall(require, "null-ls")
6+
if (not status) then
7+
return
8+
end
9+
10+
null_ls.setup {
11+
sources = {
12+
null_ls.builtins.code_actions.eslint_d,
13+
null_ls.builtins.code_actions.gitsigns,
14+
null_ls.builtins.diagnostics.eslint_d,
15+
null_ls.builtins.formatting.prettierd,
16+
},
17+
update_in_insert = true,
18+
}
19+
20+
-- keymap for code action and format
21+
vim.keymap.set({ "n", "v" }, "<leader>lc", vim.lsp.buf.code_action, { silent = true })
22+
vim.keymap.set({ "n", "v" }, "<leader>lf", vim.lsp.buf.format, { silent = true })

after_/plugin/nvim-treesitter.rc.lua

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--[[
2+
nvim-treesitter.rc.lua
3+
--]]
4+
5+
local status, treesitter_configs = pcall(require, "nvim-treesitter.configs")
6+
if (not status) then
7+
return
8+
end
9+
10+
treesitter_configs.setup {
11+
ensure_installed = { 'go', 'lua', 'python', 'rust', 'typescript' },
12+
highlight = { enable = true },
13+
indent = { enable = true },
14+
}

after_/plugin/telescope.rc.lua

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
--[[
2+
telescope.rc.lua
3+
--]]
4+
5+
local status, telescope = pcall(require, "telescope")
6+
if (not status) then
7+
return
8+
end
9+
10+
--[[
11+
telescope.setup {
12+
extensions = {
13+
file_browser = {
14+
theme = "dropdown",
15+
-- disables netrw and use telescope-file-browser instead
16+
hijack_netrw = true,
17+
},
18+
},
19+
}
20+
21+
pcall(require("telescope").load_extension "file_browser")
22+
pcall(require('telescope').load_extension "fzf")
23+
--]]
24+
25+
telescope.setup()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy