enable lsp + a bunch of other things
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
|
||||
## References
|
||||
|
||||
- [Recent (2025-11-15) example of lsp setup](https://www.youtube.com/watch?v=oBiBEx7L000)
|
||||
- [Example of rust + lsp](https://www.youtube.com/watch?v=E2mKJ73M9pg)
|
||||
- [Example of rust with nvim + lsp ](https://www.youtube.com/watch?v=E2mKJ73M9pg)
|
||||
- https://www.youtube.com/watch?v=g1gyYttzxcI
|
||||
|
||||
|
||||
|
||||
14
TODO.md
14
TODO.md
@@ -1,7 +1,17 @@
|
||||
# Problems and missing features
|
||||
|
||||
|
||||
## which packages should I use?
|
||||
|
||||
- [ ] telescope: Install and learn how to use
|
||||
- [ ] cmp-nvim or cmp-nvim-lsp or ... (autocompletion)
|
||||
|
||||
## lsp
|
||||
|
||||
- [ ] learn lsp provided capabilities and how to use it
|
||||
- [ ] which shortcut should I use?
|
||||
|
||||
|
||||
## Files browsing
|
||||
|
||||
- [ ] open oil in the current file directory
|
||||
- [ ] see the current path of oil
|
||||
- [ ] see the current path of oil
|
||||
|
||||
2
init.lua
2
init.lua
@@ -3,4 +3,4 @@ require("config.keymap")
|
||||
require("config.options")
|
||||
require("config.lazy")
|
||||
require("config.clipboard")
|
||||
|
||||
require("config.lsp")
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
{
|
||||
"kanagawa.nvim": { "branch": "master", "commit": "aef7f5cec0a40dbe7f3304214850c472e2264b10" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "b1d9a914b02ba5660f1e272a03314b31d4576fe2" },
|
||||
"mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" },
|
||||
"mini.icons": { "branch": "main", "commit": "ff2e4f1d29f659cc2bad0f9256f2f6195c6b2428" },
|
||||
"mini.statusline": { "branch": "main", "commit": "e331175f10d9f400b42523b3890841aba202ce16" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "abf6d190f2c06818489c0bd4b926e7e3a06c5e51" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"oil.nvim": { "branch": "master", "commit": "7e1cd7703ff2924d7038476dcbc04b950203b902" },
|
||||
"rustaceanvim": { "branch": "master", "commit": "88575b98bb9937fb9983ddec5e532b67e75ce677" },
|
||||
"showkeys": { "branch": "main", "commit": "cb0a50296f11f1e585acffba8c253b9e8afc1f84" },
|
||||
"smear-cursor.nvim": { "branch": "main", "commit": "abfa5835920b1d76c0e24e1465a618ad914be90a" },
|
||||
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
|
||||
|
||||
@@ -19,7 +19,21 @@ vim.keymap.set('n', "<leader>qq", "<cmd>q!<CR>", { desc = "Force to quit without
|
||||
-- TERMINAL
|
||||
-- exit t mode
|
||||
km("t", "<Esc>", "<C-\\><C-n>", { desc = "Exit terminal mode"})
|
||||
km("n", "<leader>t" , "<cmd>term<CR>", { desc = "Create a terminal" } )
|
||||
km("n", "<leader>t" , function()
|
||||
print("open terminal")
|
||||
-- function OpenTerminal()
|
||||
local dir = vim.fn.expand('%:p:h') -- if in a file
|
||||
if vim.startswith(dir, 'oil://') then -- if in an Oil buffer
|
||||
dir = string.sub(dir, 7) -- Strip 'oil://' prefix
|
||||
if vim.api.nvim_buf_get_option(0, "buftype") == "nofile" then -- is in a float
|
||||
vim.cmd.q()
|
||||
end
|
||||
end
|
||||
vim.cmd('lcd ' .. dir)
|
||||
vim.cmd('terminal')
|
||||
end
|
||||
, { desc = "Create a terminal in the current 'context'" }
|
||||
)
|
||||
|
||||
|
||||
-- todo: this is not robust... add autocompletion and verify that file exists
|
||||
|
||||
0
lua/config/lsp.lua
Normal file
0
lua/config/lsp.lua
Normal file
@@ -6,8 +6,8 @@ vim.o.smartcase = true
|
||||
|
||||
|
||||
-- use vim
|
||||
--vim.o.expandtab = true -- convert tab to spaces
|
||||
--vim.o.shiftwidth = 4
|
||||
vim.o.expandtab = true -- convert tab to spaces
|
||||
vim.o.shiftwidth = 4
|
||||
|
||||
vim.o.cursorline = true
|
||||
|
||||
|
||||
3
lua/plugins/lspconfig.lua.bak
Normal file
3
lua/plugins/lspconfig.lua.bak
Normal file
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
"neovim/nvim-lspconfig"
|
||||
}
|
||||
14
lua/plugins/mason-lspconfig.lua
Normal file
14
lua/plugins/mason-lspconfig.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
return {
|
||||
"mason-org/mason-lspconfig.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"lua_ls",
|
||||
"rust_analyzer",
|
||||
"markdown_oxide"
|
||||
},
|
||||
},
|
||||
dependencies = {
|
||||
{ "mason-org/mason.nvim", opts = {} },
|
||||
"neovim/nvim-lspconfig",
|
||||
},
|
||||
}
|
||||
4
lua/plugins/mason.lua.bak
Normal file
4
lua/plugins/mason.lua.bak
Normal file
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
"mason-org/mason.nvim",
|
||||
opts = {}
|
||||
}
|
||||
5
lua/plugins/rustacean.lua
Normal file
5
lua/plugins/rustacean.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
'mrcjkb/rustaceanvim',
|
||||
version = '^6', -- Recommended
|
||||
lazy = false, -- This plugin is already lazy
|
||||
}
|
||||
Reference in New Issue
Block a user