add typescript lsp
This commit is contained in:
parent
9626f574d1
commit
9f25cc1912
2
init.lua
2
init.lua
|
|
@ -575,7 +575,7 @@ require('lazy').setup({
|
|||
-- https://github.com/pmizio/typescript-tools.nvim
|
||||
--
|
||||
-- But for many setups, the LSP (`tsserver`) will work just fine
|
||||
-- tsserver = {},
|
||||
tsserver = {},
|
||||
--
|
||||
|
||||
lua_ls = {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,57 @@
|
|||
return {
|
||||
'ThePrimeagen/harpoon',
|
||||
branch = 'harpoon2',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
config = function()
|
||||
local harpoon = require 'harpoon'
|
||||
harpoon:setup {}
|
||||
|
||||
-- basic telescope configuration
|
||||
local conf = require('telescope.config').values
|
||||
local function toggle_telescope(harpoon_files)
|
||||
local file_paths = {}
|
||||
for _, item in ipairs(harpoon_files.items) do
|
||||
table.insert(file_paths, item.value)
|
||||
end
|
||||
|
||||
require('telescope.pickers')
|
||||
.new({}, {
|
||||
prompt_title = 'Harpoon',
|
||||
finder = require('telescope.finders').new_table {
|
||||
results = file_paths,
|
||||
},
|
||||
previewer = conf.file_previewer {},
|
||||
sorter = conf.generic_sorter {},
|
||||
})
|
||||
:find()
|
||||
end
|
||||
|
||||
vim.keymap.set('n', '<C-e>', function()
|
||||
toggle_telescope(harpoon:list())
|
||||
end, { desc = 'Open harpoon window' })
|
||||
|
||||
vim.keymap.set('n', '<leader>a', function()
|
||||
harpoon:list():add()
|
||||
end)
|
||||
vim.keymap.set('n', '<C-u>', function()
|
||||
harpoon:list():select(1)
|
||||
end)
|
||||
vim.keymap.set('n', '<C-i>', function()
|
||||
harpoon:list():select(2)
|
||||
end)
|
||||
vim.keymap.set('n', '<C-o>', function()
|
||||
harpoon:list():select(3)
|
||||
end)
|
||||
vim.keymap.set('n', '<C-p>', function()
|
||||
harpoon:list():select(4)
|
||||
end)
|
||||
|
||||
-- Toggle previous & next buffers stored within Harpoon list
|
||||
vim.keymap.set('n', '<C-S-H>', function()
|
||||
harpoon:list():prev()
|
||||
end)
|
||||
vim.keymap.set('n', '<C-S-L>', function()
|
||||
harpoon:list():next()
|
||||
end)
|
||||
end,
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
'pmizio/typescript-tools.nvim',
|
||||
dependencies = { 'nvim-lua/plenary.nvim', 'neovim/nvim-lspconfig' },
|
||||
opts = {},
|
||||
}
|
||||
Loading…
Reference in New Issue