Add flutter-tools neovim plugin
parent
610563bde4
commit
11a9ac9f30
|
@ -24,8 +24,8 @@ return require('packer').startup {
|
||||||
-- use { 'Shougo/vimproc.vim', run = 'make' } -- Not really used
|
-- use { 'Shougo/vimproc.vim', run = 'make' } -- Not really used
|
||||||
use 'vim-scripts/utl.vim' -- Universal text linking
|
use 'vim-scripts/utl.vim' -- Universal text linking
|
||||||
use { --
|
use { --
|
||||||
'mbbill/undotree', --
|
'mbbill/undotree', --
|
||||||
cmd = 'UndotreeToggle' --
|
cmd = 'UndotreeToggle' --
|
||||||
} -- Undos in a tree for easy access
|
} -- Undos in a tree for easy access
|
||||||
use 'mhinz/vim-grepper' -- Grepper command - improved grepping throughout project
|
use 'mhinz/vim-grepper' -- Grepper command - improved grepping throughout project
|
||||||
use 'radenling/vim-dispatch-neovim' -- vim-dispatch for neovim - uses terminal
|
use 'radenling/vim-dispatch-neovim' -- vim-dispatch for neovim - uses terminal
|
||||||
|
@ -61,19 +61,22 @@ return require('packer').startup {
|
||||||
|
|
||||||
-- Treesitter --
|
-- Treesitter --
|
||||||
use { --
|
use { --
|
||||||
'nvim-treesitter/nvim-treesitter', --
|
'nvim-treesitter/nvim-treesitter', --
|
||||||
run = ':TSUpdate' --
|
run = ':TSUpdate' --
|
||||||
} -- Treesitter integration
|
} -- Treesitter integration
|
||||||
use 'nvim-treesitter/playground' -- TSPlaygroundToggle - access treesitter data
|
use 'nvim-treesitter/playground' -- TSPlaygroundToggle - access treesitter data
|
||||||
|
|
||||||
-- LSP --
|
-- LSP --
|
||||||
use 'tjdevries/nlua.nvim' -- Built-in Lua integration with LSP
|
|
||||||
use 'neovim/nvim-lspconfig' -- Easy LSP Config
|
use 'neovim/nvim-lspconfig' -- Easy LSP Config
|
||||||
use 'alexaandru/nvim-lspupdate' -- Easy install and update for many LSP servers
|
use 'alexaandru/nvim-lspupdate' -- Easy install and update for many LSP servers
|
||||||
use 'nvim-lua/completion-nvim' -- LSP completion integration
|
use 'nvim-lua/completion-nvim' -- LSP completion integration
|
||||||
use 'nvim-treesitter/completion-treesitter' -- Treesitter completion integration
|
use 'nvim-treesitter/completion-treesitter' -- Treesitter completion integration
|
||||||
use 'nvim-lua/lsp_extensions.nvim' -- LSP extensions (like closing labels for Dart)
|
use 'nvim-lua/lsp_extensions.nvim' -- LSP extensions (like closing labels for Dart)
|
||||||
|
|
||||||
|
-- LSP language specific
|
||||||
|
use 'tjdevries/nlua.nvim' -- Built-in Lua integration with LSP
|
||||||
|
use 'akinsho/flutter-tools.nvim' -- Additional flutter integrations
|
||||||
|
|
||||||
-- Lua support --
|
-- Lua support --
|
||||||
use 'tjdevries/astronauta.nvim' -- Support for lua ftplugins and plugins
|
use 'tjdevries/astronauta.nvim' -- Support for lua ftplugins and plugins
|
||||||
use 'nvim-lua/popup.nvim' -- Popup API integration - needed for some plugins
|
use 'nvim-lua/popup.nvim' -- Popup API integration - needed for some plugins
|
||||||
|
|
|
@ -12,7 +12,7 @@ local on_attach = function(client, bufnr)
|
||||||
|
|
||||||
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
|
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||||
|
|
||||||
default_opts = {noremap = true, silent = true}
|
local default_opts = {noremap = true, silent = true}
|
||||||
|
|
||||||
-- Lsp keymaps
|
-- Lsp keymaps
|
||||||
buf_set_keymap('n', '<C-]>', '<cmd>lua vim.lsp.buf.definition()<CR>', default_opts)
|
buf_set_keymap('n', '<C-]>', '<cmd>lua vim.lsp.buf.definition()<CR>', default_opts)
|
||||||
|
@ -25,14 +25,14 @@ local on_attach = function(client, bufnr)
|
||||||
buf_set_keymap('n', '<Leader>ac', '<cmd>lua vim.lsp.buf.code_action()<CR>', default_opts)
|
buf_set_keymap('n', '<Leader>ac', '<cmd>lua vim.lsp.buf.code_action()<CR>', default_opts)
|
||||||
buf_set_keymap('n', '<Leader>a', '<cmd>lua vim.lsp.buf.code_action_range()<CR>', default_opts)
|
buf_set_keymap('n', '<Leader>a', '<cmd>lua vim.lsp.buf.code_action_range()<CR>', default_opts)
|
||||||
|
|
||||||
completion_opts = {silent = true}
|
local completion_opts = {silent = true}
|
||||||
|
|
||||||
-- Completion keymaps
|
-- Completion keymaps
|
||||||
buf_set_keymap('i', '<C-n>', '<Plug>(completion_trigger)', completion_opts)
|
buf_set_keymap('i', '<C-n>', '<Plug>(completion_trigger)', completion_opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Lsp default language servers
|
-- Lsp default language servers
|
||||||
local servers = { "bashls", "clangd", "dartls", "jsonls", "pyright", "rust_analyzer", "kotlin_language_server", "vimls" }
|
local servers = { "bashls", "clangd", "jsonls", "pyright", "rust_analyzer", "kotlin_language_server", "vimls" }
|
||||||
for _, lsp in ipairs(servers) do
|
for _, lsp in ipairs(servers) do
|
||||||
lspconfig[lsp].setup { on_attach = on_attach }
|
lspconfig[lsp].setup { on_attach = on_attach }
|
||||||
end
|
end
|
||||||
|
@ -42,6 +42,12 @@ require('nlua.lsp.nvim').setup(lspconfig, {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
|
|
||||||
-- Include globals you want to tell the LSP are real :)
|
-- Include globals you want to tell the LSP are real :)
|
||||||
globals = {
|
globals = {}
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Flutter tools
|
||||||
|
require('flutter-tools').setup {
|
||||||
|
lsp = {
|
||||||
|
on_attach = on_attach
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue