-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
123 lines (96 loc) · 3.14 KB
/
init.lua
File metadata and controls
123 lines (96 loc) · 3.14 KB
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
vim.g.mapleader = '\\'
vim.opt.clipboard:append("unnamedplus")
-- According to claude this is unreliable if you don't use a term with the kitty keyboard protocol
vim.keymap.set("t", "<C-Esc>", "<C-\\><C-n>", { desc = "Exit terminal mode" })
vim.keymap.set('n', '<leader>i', function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
end, { desc = 'Toggle inlay hints' })
vim.g.clipboard = {
name = 'OSC 52',
copy = {
['+'] = require('vim.ui.clipboard.osc52').copy('+'),
['*'] = require('vim.ui.clipboard.osc52').copy('*'),
},
paste = {
['+'] = require('vim.ui.clipboard.osc52').paste('+'),
['*'] = require('vim.ui.clipboard.osc52').paste('*'),
},
}
-- let g:clipboard = 'osc52'
-- vim.keymap.set("t", "<Esc><Esc>", "<C-\\><C-n>", { desc = "Exit terminal mode" })
vim.keymap.set('n', '<leader>d', function()
vim.diagnostic.open_float()
end)
vim.keymap.set('n', '<leader>D', '<cmd>Telescope diagnostics bufnr=0<cr>', { desc = 'list all found diagnostics in current buffer' })
vim.keymap.set("n", "<leader>f", function()
require("telescope").extensions.file_browser.file_browser()
end, { noremap = true })
vim.keymap.set('n', '<leader>bf', '<cmd>Telescope buffers<cr>', { desc = 'Find buffers' })
vim.keymap.set('n', '<leader>i', function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
end)
-- ai slop bind - verify if ture
vim.keymap.set('n', 'gy', ':tabp<CR>', { noremap = true, silent = true })
-- LSP hover on current token
vim.keymap.set('n', '<leader>h', vim.lsp.buf.hover, { desc = 'LSP Hover' })
-- Detailed LSP inspect on current token
vim.keymap.set('n', '<leader>H', function()
local params = vim.lsp.util.make_position_params()
local result = vim.lsp.buf_request_sync(0, 'textDocument/hover', params, 1000)
print(vim.inspect(result))
end, { desc = 'LSP Inspect token' })
-- Visual studio "refactor"
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename)
require('config.lazy')
-- vim.cmd('source ~/.config/nvim/vimbindings.vim') -- escape hatch
vim.opt.relativenumber = true
vim.opt.number = true
vim.opt.splitright = true
vim.g.markdown_fenced_languages = {
"ts=typescript",
"tsx=typescript"
}
vim.lsp.inlay_hint.enable(true)
-- require'lspconfig'.eslint.setup{}
-- require'lspconfig'.ts_ls.setup{}
-- require'lspconfig'.clangd.setup{}
-- require'lspconfig'.pylsp.setup{}
-- the docs do this in a new way for some reason?
vim.lsp.config('rust_analyzer', {
settings = {
['rust-analyzer'] = {
diagnostics = {
enable = true;
},
inlayHints = {
enable = true,
chainingHints = {
enable = true,
},
typeHints = {
enable = true,
hideClosureInitialization = false,
hideNamedConstructor = false,
},
parameterHints = {
enable = true,
},
}
}
}
})
vim.lsp.config('ts_ls', {
cmd = { "typescript-language-server", "--stdio" },
init_options = {
tsserver = {
path = "/usr/lib/node_modules/typescript/lib/tsserver.js"
}
}
})
vim.lsp.enable('rust_analyzer')
vim.lsp.enable('nixd')
vim.lsp.enable('ts_ls')
vim.lsp.enable('pylsp')
vim.lsp.enable('clangd')
-- vim.cmd 'colorscheme habamax'
vim.cmd 'colorscheme evergarden-winter'