4 次代码提交 5b06993f25 ... e203d67abb

作者 SHA1 备注 提交日期
  Nikita Chursin e203d67abb additional fixes 1 月之前
  Nikita Chursin f01ef7c04b turned off return autobrackets, cause there is a bug with returning functions 4 月之前
  Nikita Chursin ce3b3a274d go pair brackets on return autofix 4 月之前
  Nikita Chursin 242a567d44 fixed for debug 4 月之前

+ 12 - 5
lua/ncvim/core_plugins/debug/debug_adapters/go.lua

@@ -23,16 +23,20 @@ ncvim.plugin {
         -- to start the process in a random available port
         port = "38697",
         -- additional args to pass to dlv
-        args = {}
+        args = {
+
+        }
       },
     })
 
     dap.adapters.delve = {
       type = 'server',
-      port = '${port}',
+      -- port = '${port}',
+      port = '38697',
       executable = {
         command = 'dlv',
-        args = { 'dap', '-l', '127.0.0.1:${port}' },
+        -- args = { 'dap', '-l', '127.0.0.1:${port}' },
+        args = { 'dap', '-l', '127.0.0.1:38697' },
       }
     }
 
@@ -49,8 +53,11 @@ ncvim.plugin {
       {
         -- Must be "go" or it will be ignored by the plugin
         type = "go",
-        name = "Attach remote",
-        mode = "remote",
+        name = "Attach",
+        -- mode = "remote",
+        mode = "local",
+        -- processId = "${command:pickProcess}",
+        processId = 14402,
         request = "attach",
       },
       -- {

+ 17 - 0
lua/ncvim/core_plugins/lsp/functions.lua

@@ -0,0 +1,17 @@
+local bufopts = {
+  noremap = true,
+  silent = true,
+  -- buffer=bufnr
+}
+
+vim.lsp.inlay_hint.enable(true)
+
+ncvim.lsp.on_attach = function(client, bufnr)
+  -- Enable completion triggered by <c-x><c-o>
+  vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
+
+  vim.keymap.set('n', '<leader>rn', '<cmd> lua vim.lsp.buf.rename()<CR>', bufopts)
+  vim.keymap.set('n', '<leader>qf', '<cmd> lua vim.lsp.buf.code_action()<CR>', bufopts)
+
+  require("lsp-format").on_attach(client)
+end

+ 1 - 0
lua/ncvim/core_plugins/lsp/init.lua

@@ -3,3 +3,4 @@ require('ncvim.core_plugins.lsp.mason')
 require('ncvim.core_plugins.lsp.lightbulbs')
 require('ncvim.core_plugins.lsp.commenting')
 require('ncvim.core_plugins.lsp.formatting')
+require('ncvim.core_plugins.lsp.functions')

+ 9 - 9
lua/ncvim/core_plugins/lsp/mason/init.lua

@@ -1,13 +1,13 @@
 local config = require('ncvim.core_plugins.lsp.mason.config')
 
 ncvim.plugin({
-    'williamboman/mason.nvim',
-    run = ":MasonUpdate",
-    requires = {
-        'neovim/nvim-lspconfig',
-        'williamboman/mason-lspconfig.nvim',
-        'hrsh7th/cmp-nvim-lsp',
-        'lukas-reineke/lsp-format.nvim',
-    },
-    config = config
+  'williamboman/mason.nvim',
+  run = ":MasonUpdate",
+  requires = {
+    'neovim/nvim-lspconfig',
+    'williamboman/mason-lspconfig.nvim',
+    'hrsh7th/cmp-nvim-lsp',
+    'lukas-reineke/lsp-format.nvim',
+  },
+  config = config,
 })

+ 4 - 1
lua/ncvim/core_plugins/lua.lua

@@ -1,6 +1,9 @@
 ncvim.plugin({
   "folke/lua-dev.nvim",
-  "nvim-lua/plenary.nvim",
+  {
+    "nvim-lua/plenary.nvim",
+    lazy = false,
+  },
   "ii14/neorepl.nvim",
   "ckipp01/stylua-nvim",
 })

+ 11 - 1
lua/ncvim/mission_control.lua

@@ -251,7 +251,7 @@ ncvim = {
     -- }
   },
   packer_bootstrap = false,
-  lazy_bootstrap = false,
+  lazy_bootstrap = true,
   pickers = {
     sessions = function()
       print('not implemented')
@@ -259,9 +259,19 @@ ncvim = {
   },
   autocmds = {},
 
+  post_install = {},
+
   custom = {},
 }
 
+
+ncvim.add_post_install = function(script)
+  table.insert(
+    ncvim.post_install,
+    script
+  )
+end
+
 require('ncvim.utils')
 
 ncvim.add_autocmd = function(events, config)

+ 1 - 1
lua/ncvim/ui/themes/init.lua

@@ -1,7 +1,7 @@
-local Path = require('plenary.path')
 ncvim.plugin(require('ncvim.ui.themes.theme2'))
 
 local function write_theme_config(config)
+  local Path = require('plenary.path')
   local config_path = Path.new(vim.fn.stdpath('config'))
   -- local config_path = Path.expand( vim.fn.stdpath('config') )
   local filepath = Path.joinpath(config_path, 'lua', 'custom', 'theme.lua')

+ 5 - 0
lua/ncvim/ui/welcome_screen/init.lua

@@ -1,5 +1,5 @@
+local v = vim.version()
+local version = " v" .. v.major .. "." .. v.minor .. "." .. v.patch
 
 ncvim.plugin({
   'goolord/alpha-nvim',
@@ -52,6 +52,9 @@ ncvim.plugin({
       [[                                                                                          ]],
     }
 
+    dashboard.section.footer.val = {
+      version,
+    }
     -- dashboard.section.footer = {
     --   type = 'text',
     --   val = {

+ 12 - 11
lua/preload.lua

@@ -1,15 +1,15 @@
-local ensure_packer = function()
-  local fn = vim.fn
-  local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
-  if fn.empty(fn.glob(install_path)) > 0 then
-    fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path })
-    vim.cmd [[packadd packer.nvim]]
-    return true
-  end
-  return false
-end
+-- local ensure_packer = function()
+--   local fn = vim.fn
+--   local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
+--   if fn.empty(fn.glob(install_path)) > 0 then
+--     fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path })
+--     vim.cmd [[packadd packer.nvim]]
+--     return true
+--   end
+--   return false
+-- end
 
-vim.g.packer_bootstrap = ensure_packer()
+-- vim.g.packer_bootstrap = ensure_packer()
 
 local ensure_lazy = function()
   local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
@@ -25,6 +25,7 @@ local ensure_lazy = function()
     return true
   end
   vim.opt.rtp:prepend(lazypath)
+
   return false
 end
 

+ 0 - 0
lua/setup_ncvim.lua


部分文件因为文件数量过多而无法显示