From 11a9ac9f30021a42b4c6d8811969eea68848649e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Wed, 17 Mar 2021 20:34:03 +0100 Subject: [PATCH] Add flutter-tools neovim plugin --- symlinks/config/nvim/lua/init/plugins.lua | 13 ++++++++----- symlinks/config/nvim/lua/lsp/servers.lua | 16 +++++++++++----- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/symlinks/config/nvim/lua/init/plugins.lua b/symlinks/config/nvim/lua/init/plugins.lua index b0e3f7c..1753b20 100644 --- a/symlinks/config/nvim/lua/init/plugins.lua +++ b/symlinks/config/nvim/lua/init/plugins.lua @@ -24,8 +24,8 @@ return require('packer').startup { -- use { 'Shougo/vimproc.vim', run = 'make' } -- Not really used use 'vim-scripts/utl.vim' -- Universal text linking use { -- - 'mbbill/undotree', -- - cmd = 'UndotreeToggle' -- + 'mbbill/undotree', -- + cmd = 'UndotreeToggle' -- } -- Undos in a tree for easy access use 'mhinz/vim-grepper' -- Grepper command - improved grepping throughout project use 'radenling/vim-dispatch-neovim' -- vim-dispatch for neovim - uses terminal @@ -61,19 +61,22 @@ return require('packer').startup { -- Treesitter -- use { -- - 'nvim-treesitter/nvim-treesitter', -- - run = ':TSUpdate' -- + 'nvim-treesitter/nvim-treesitter', -- + run = ':TSUpdate' -- } -- Treesitter integration use 'nvim-treesitter/playground' -- TSPlaygroundToggle - access treesitter data -- LSP -- - use 'tjdevries/nlua.nvim' -- Built-in Lua integration with LSP use 'neovim/nvim-lspconfig' -- Easy LSP Config use 'alexaandru/nvim-lspupdate' -- Easy install and update for many LSP servers use 'nvim-lua/completion-nvim' -- LSP completion integration use 'nvim-treesitter/completion-treesitter' -- Treesitter completion integration 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 -- use 'tjdevries/astronauta.nvim' -- Support for lua ftplugins and plugins use 'nvim-lua/popup.nvim' -- Popup API integration - needed for some plugins diff --git a/symlinks/config/nvim/lua/lsp/servers.lua b/symlinks/config/nvim/lua/lsp/servers.lua index 07a30f8..cf0d291 100644 --- a/symlinks/config/nvim/lua/lsp/servers.lua +++ b/symlinks/config/nvim/lua/lsp/servers.lua @@ -12,7 +12,7 @@ local on_attach = function(client, bufnr) buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') - default_opts = {noremap = true, silent = true} + local default_opts = {noremap = true, silent = true} -- Lsp keymaps buf_set_keymap('n', '', 'lua vim.lsp.buf.definition()', default_opts) @@ -25,14 +25,14 @@ local on_attach = function(client, bufnr) buf_set_keymap('n', 'ac', 'lua vim.lsp.buf.code_action()', default_opts) buf_set_keymap('n', 'a', 'lua vim.lsp.buf.code_action_range()', default_opts) - completion_opts = {silent = true} + local completion_opts = {silent = true} -- Completion keymaps buf_set_keymap('i', '', '(completion_trigger)', completion_opts) end -- 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 lspconfig[lsp].setup { on_attach = on_attach } end @@ -42,6 +42,12 @@ require('nlua.lsp.nvim').setup(lspconfig, { on_attach = on_attach, -- Include globals you want to tell the LSP are real :) - globals = { - } + globals = {} }) + +-- Flutter tools +require('flutter-tools').setup { + lsp = { + on_attach = on_attach + } +}