1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
-- WINDOWS SHELL COMPATIBILITY (needed for sf.nvim command runner)
if vim.fn.has("win32") == 1 then
vim.opt.shell = "cmd.exe"
vim.opt.shellcmdflag = "/s /c"
vim.opt.shellquote = ""
vim.opt.shellxquote = '"' -- Crucial for handling quotes and && properly in cmd
end
-- plugins --
vim.pack.add({
'https://github.com/stevearc/oil.nvim',
'https://github.com/nvim-mini/mini.move',
'https://github.com/nvim-mini/mini.icons',
'https://github.com/ibhagwan/fzf-lua',
'https://github.com/xixiaofinland/sf.nvim',
'https://github.com/nvim-treesitter/nvim-treesitter',
-- [completion] ---------------------------------------------------------------
{ src = "https://github.com/Saghen/blink.cmp", version = vim.version.range('v1.10.2') },
})
require("oil").setup()
require("mini.move").setup()
require("mini.icons").setup()
require("fzf-lua").setup()
require("nvim-treesitter").setup()
require("blink.cmp").setup()
require("sf").setup({
types_to_retrieve = {
"ApexClass",
"ApexTrigger",
"CustomPermission",
"CustomApplication",
"CustomMetadata",
"CustomSetting",
"CustomTab",
"CustomObject",
"Flow",
"FlowDefinition",
"Layout",
"LightningComponentBundle",
"PermissionSetGroup",
"PermissionSet",
"Profile",
"StaticResource",
"SharingRule"
},
})
vim.loader.enable() -- speed up launch!
-- treesitter - dynamically determine language
vim.api.nvim_create_autocmd("FileType", {
group = vim.api.nvim_create_augroup("tree-sitter-enable", { clear = true }),
callback = function(args)
local lang = vim.treesitter.language.get_lang(args.match)
if not lang then
return
end
if vim.treesitter.query.get(lang, "highlights") then
vim.treesitter.start(args.buf)
end
if vim.treesitter.query.get(lang, "indents") then
vim.opt_local.indentexpr = 'v:lua.require("nvim-treesitter").indentexpr()'
end
-- from treesitter docs for folding
vim.opt.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
vim.opt.foldmethod = 'expr'
end,
})
-- normal mode
vim.api.nvim_set_keymap('i','jk','<Esc>',{noremap=true,silent=true})
vim.api.nvim_set_keymap('i','kj','<Esc>',{noremap=true,silent=true})
-- ui
vim.opt.foldlevelstart = 99
vim.o.scrolloff = 10
vim.o.number = true
vim.o.relativenumber = true
vim.o.showmode = false
vim.o.signcolumn = "yes"
vim.o.pumheight = 15
vim.o.shortmess = "CFOSWaco"
-- search
vim.o.imsearch = 0
vim.o.hlsearch = true
vim.o.incsearch = true
vim.o.ignorecase = true
vim.o.smartcase = true
local map = vim.keymap.set
-- KEYMAPS - for plugins
map("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })
-- KEYMAPS - movement
map("n", "<C-d>", "<C-d>zz")
map("n", "<C-u>", "<C-u>zz")
map("n", "<C-f>", "<C-f>zz")
map("n", "<C-b>", "<C-b>zz")
|