diff --git a/article/golang/golang-dev.md b/article/golang/golang-dev.md new file mode 100644 index 0000000..47f6d37 --- /dev/null +++ b/article/golang/golang-dev.md @@ -0,0 +1,28 @@ +# Golang 开发 + +## module + +### init a package + +```bash +go mod init +``` + +### remove unused packages + +```bash +go mod tidy +``` + +## dlv 调试 + +## vim-go/go-nvim + +packages.Load error 处理: + +清除缓存试试: + +```bash +go clean -cache +``` + diff --git a/article/golang/module.md b/article/golang/module.md deleted file mode 100644 index 642c033..0000000 --- a/article/golang/module.md +++ /dev/null @@ -1,13 +0,0 @@ -# module usage - -## init a package - -```bash -go mod init -``` - -## remove unused packages - -```bash -go mod tidy -``` diff --git a/article/golang/vim-go.md b/article/golang/vim-go.md deleted file mode 100644 index e8f65cb..0000000 --- a/article/golang/vim-go.md +++ /dev/null @@ -1,10 +0,0 @@ -# Vim-go Usage - -## vim-go: : packages.Load error - -Type the commands bellow: - -```bash -go clean -cache -``` - diff --git a/article/neovim.md b/article/neovim.md index f575d67..21d3058 100644 --- a/article/neovim.md +++ b/article/neovim.md @@ -22,6 +22,12 @@ vim.api.nvim_exec2 print(vim.inspect(table)) ``` +或者 `vim.print`,以可读的方式输打印参数,如: + +```lua +vim.print(vim.fn.api_info()) +``` + ```lua -- execute system command local has_cmd = function(cmd) diff --git a/config/nvim/lua/editor/autopairs.lua b/config/nvim/lua/editor/autopairs.lua index bd900b0..4341e29 100644 --- a/config/nvim/lua/editor/autopairs.lua +++ b/config/nvim/lua/editor/autopairs.lua @@ -1,6 +1,7 @@ -- Setup nvim-cmp. local status_ok, npairs = pcall(require, "nvim-autopairs") if not status_ok then + vim.notify("nvim-autopairs load error") return end diff --git a/config/nvim/lua/editor/cmp.lua b/config/nvim/lua/editor/cmp.lua index 12b270f..47db2f0 100644 --- a/config/nvim/lua/editor/cmp.lua +++ b/config/nvim/lua/editor/cmp.lua @@ -6,7 +6,7 @@ end local ok, luasnip = pcall(require, "luasnip") if not ok then - print("luasnip load error") + vim.notify("luasnip load error") return end diff --git a/config/nvim/lua/editor/indentline.lua b/config/nvim/lua/editor/indentline.lua index ec97a1f..e9650b2 100644 --- a/config/nvim/lua/editor/indentline.lua +++ b/config/nvim/lua/editor/indentline.lua @@ -6,17 +6,20 @@ end ibl.update({ exclude = { filetypes = { - 'c', - 'cpp', - 'h', - 'hpp', - 'java', - 'json', - 'json5', - 'nu', - 'go', - 'rust', - 'xml', + "c", + "cc", + "cxx", + "cpp", + "h", + "hpp", + "hxx", + "java", + "json", + "json5", + "nu", + "go", + "rust", + "xml", } } }) @@ -29,8 +32,8 @@ ibl.update({ -- } -- -- vim.g.indent_blankline_filetype = { --- 'python', --- 'lua', +-- "python", +-- "lua", -- } -- -- -- vim.g.indent_blankline_filetype_exclude = { @@ -39,8 +42,8 @@ ibl.update({ -- -- "help", -- -- "man", -- -- "neogitstatus", --- -- 'nerdtree', --- -- 'vista', +-- -- "nerdtree", +-- -- "vista", -- -- "startify", -- -- "packer", -- -- "NvimTree", diff --git a/config/nvim/lua/lang/python.lua b/config/nvim/lua/lang/python.lua index e07bd70..98e0858 100644 --- a/config/nvim/lua/lang/python.lua +++ b/config/nvim/lua/lang/python.lua @@ -7,7 +7,7 @@ local possible_pythons = { '/opt/homebrew/bin/python3', } -for i, v in pairs(possible_pythons) do +for _, v in pairs(possible_pythons) do if vim.fn.filereadable(v) == 1 then vim.api.nvim_set_var('python3_host_prog', v) break @@ -16,22 +16,3 @@ end vim.api.nvim_set_var('python_highlight_all', 1) --- pymode settings --- vim.g.pymode = 1 --- vim.g.pymode_trim_whitespaces = 1 --- vim.g.pymode_options_max_line_length = 120 --- vim.g.pymode_lint_options_pep8 = {max_line_length = vim.g.pymode_options_max_line_length} --- --- vim.g.pymode_rope = 1 --- vim.g.pymode_rope_refix = '' --- vim.g.pymode_lint_cwindow = 0 --- --- -- set completeopt=menuone,noinsert --- vim.api.nvim_set_var('completeopt', {'menuone', 'noinsert'}) --- vim.g.pymode_rope_completion = 1 --- vim.g.pymode_rope_complete_on_dot = 1 --- vim.g.pymode_rope_autoimport_modules = {'os', 'shutil', 'datetime'} --- --- -- Find definition --- vim.g.pymode_rope_goto_definition_bind = 'g' --- vim.g.pymode_rope_goto_definition_cmd = 'new'