浏览代码

Define shell + php lsp + dart lsp + flutter + relative number (#188)

Biser Stoilov 4 年之前
父节点
当前提交
5f22c1bace
共有 7 个文件被更改,包括 27 次插入1 次删除
  1. 2 0
      init.lua
  2. 11 0
      lua/lsp/dart-ls.lua
  3. 4 0
      lua/lsp/php-ls.lua
  4. 1 0
      lua/nv-floaterm/init.lua
  5. 5 1
      lua/nv-globals.lua
  6. 3 0
      lua/plugins.lua
  7. 1 0
      lua/settings.lua

+ 2 - 0
init.lua

@@ -45,6 +45,8 @@ vim.cmd('source ~/.config/nvim/vimscript/functions.vim')
 -- LSP
 require('lsp')
 require('lsp.clangd')
+require('lsp.php-ls')
+require('lsp.dart-ls')
 require('lsp.lua-ls')
 require('lsp.bash-ls')
 require('lsp.go-ls')

+ 11 - 0
lua/lsp/dart-ls.lua

@@ -0,0 +1,11 @@
+require'lspconfig'.dartls.setup{
+    cmd = { "dart", O.dart.sdk_path, "--lsp" },
+    on_attach = require'lsp'.common_on_attach,
+    init_options = {
+      closingLabels = false,
+      flutterOutline = false,
+      onlyAnalyzeProjectsWithOpenFiles = false,
+      outline = false,
+      suggestFromUnimportedLibraries = true
+    }
+}

+ 4 - 0
lua/lsp/php-ls.lua

@@ -0,0 +1,4 @@
+require'lspconfig'.intelephense.setup {
+    cmd = { DATA_PATH .. "/lspinstall/php/node_modules/.bin/intelephense", "--stdio" },
+    on_attach = require'lsp'.common_on_attach
+}

+ 1 - 0
lua/nv-floaterm/init.lua

@@ -6,6 +6,7 @@ vim.g.floaterm_keymap_new    = '<F4>'
 vim.g.floaterm_title=''
 
 vim.g.floaterm_gitcommit='floaterm'
+vim.g.floaterm_shell=O.shell
 vim.g.floaterm_autoinsert=1
 vim.g.floaterm_width=0.8
 vim.g.floaterm_height=0.8

+ 5 - 1
lua/nv-globals.lua

@@ -2,6 +2,8 @@ O = {
     auto_close_tree = 0,
     auto_complete = true,
     colorscheme = 'nvcode',
+    relative_number = true,
+    shell = "bash",
     python = {
         linter = '',
         -- @usage can be 'yapf', 'black'
@@ -10,7 +12,9 @@ O = {
         isort = false,
         diagnostics = {virtual_text = true, signs = true, underline = true}
     },
-
+    dart = {
+        sdk_path = '/usr/lib/dart/bin/snapshots/analysis_server.dart.snapshot'
+    },
     lua = {
         -- @usage can be 'lua-format'
         formatter = '',

+ 3 - 0
lua/plugins.lua

@@ -87,6 +87,9 @@ return require('packer').startup(function(use)
     -- use 'gennaro-tedesco/nvim-jqx'
     -- use 'turbio/bracey.vim'
 
+    -- Flutter
+    use 'thosakwe/vim-flutter'
+
     -- Registers
     -- use 'gennaro-tedesco/nvim-peekup'
 

+ 1 - 0
lua/settings.lua

@@ -19,6 +19,7 @@ vim.cmd('set sw=4') -- Change the number of space characters inserted for indent
 vim.bo.expandtab = true -- Converts tabs to spaces
 vim.bo.smartindent = true -- Makes indenting smart
 vim.wo.number = true -- set numbered lines
+vim.wo.relativenumber = O.relative_number -- set relative number
 vim.wo.cursorline = true -- Enable highlighting of the current line
 vim.o.showtabline = 2 -- Always show tabs
 vim.o.showmode = false -- We don't need to see things like -- INSERT -- anymore