enable lsp + a bunch of other things
This commit is contained in:
@@ -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