all repos

dotfiles @ da1068fdc2e6c53bd0ef2b816c417338a6078f5a

my dotfiles
15 files changed, 169 insertions(+), 127 deletions(-)
update lvim
Author: neoteny ss2316544@gmail.com
Committed at: 2021-10-03 17:31:30 +0300
Parent: a537cad
M config/lvim/config.lua

@@ -12,94 +12,29 @@ lvim.builtin.gitsigns.opts.current_line_blame = true

lvim.builtin.gitsigns.opts.current_line_blame_opts = { delay = 200 } -- TreeSitter -lvim.builtin.treesitter.ensure_installed = { "javascript", "typescript", "jsdoc", "lua", "go" } -lvim.builtin.treesitter.indent.disable = { "clojure", "java", "python" } +lvim.builtin.treesitter.ensure_installed = { + "javascript", + "typescript", + "jsdoc", + "yaml", + "toml", + "lua", + "go", +} +lvim.builtin.treesitter.indent.disable = { "python" } -- Telescope lvim.builtin.telescope.defaults.layout_config.prompt_position = "top" -lvim.builtin.telescope.defaults.file_ignore_patterns = { ".git", "node_modules", "env", ".bin" } +lvim.builtin.telescope.defaults.file_ignore_patterns = { + ".git", + "node_modules", + "env", + ".bin", +} -- NvimTree lvim.builtin.nvimtree.ignore = { ".git", "node_modules", ".bin", "env" } --- Mappings -lvim.keys.normal_mode["<C-w>"] = "<cmd>BufferClose<cr>" -lvim.keys.normal_mode["<C-s>"] = "<cmd>w<cr>" -lvim.keys.visual_mode["jk"] = "<esc>" -lvim.builtin.which_key.mappings.l.a = { "<cmd>Telescope lsp_code_actions<cr>", "Code Actions" } -lvim.builtin.which_key.mappings.l.d = { "<cmd>TroubleToggle<cr>", "Diagnostics" } -lvim.builtin.which_key.mappings.l.R = { "<cmd>TroubleToggle lsp_references<cr>", "References" } -lvim.builtin.which_key.mappings["t"] = { - name = "Test", - t = { "<cmd>Ultest<cr>", "Run test" }, - s = { "<cmd>UltestStop<cr>", "Stop test" }, - c = { "<cmd>UltestClear<cr>", "Clear test result" }, - n = { "<cmd>UltestNearest<cr>", "Run test order by cursor" }, - o = { "<cmd>UltestOutput<cr>", "Show output order by cursor" }, - j = { "<Plug>(ultest-next-fail)", "Next fail" }, - k = { "<Plug>(ultest-prev-fail)", "Prev fail" }, -} - -for i = 1, 9 do - lvim.keys.normal_mode[string.format("<A-%d>", i)] = string.format("<cmd>BufferGoto %d<cr>", i) -end - --- Pluginos -lvim.plugins = { - { "tpope/vim-surround", keys = { "c", "y", "d" }, event = "BufRead" }, - { "folke/trouble.nvim", cmd = { "TroubleToggle" } }, - { "editorconfig/editorconfig-vim" }, - { - "theHamsta/nvim-dap-virtual-text", - config = function() - require("user.conjure").setup() - end, - }, - { - "folke/todo-comments.nvim", - event = "BufRead", - config = function() - require("todo-comments").setup({}) - end, - }, - { - "tzachar/cmp-tabnine", - run = "./install.sh", - event = "InsertEnter", - config = function() - require("cmp_tabnine.config"):setup({ - max_lines = 1000, - max_num_results = 10, - sort = true, - }) - end, - }, - { - "folke/lua-dev.nvim", - ft = "lua", - config = function() - require("user.lua-dev").setup() - end, - }, - { - "Smirnov-O/ts-unit.nvim", - keys = { "vip", "cip", "yip", "dip" }, - config = function() - require("ts-unit").setup({ keymaps = true }) - end, - }, - { - "Olical/conjure", - ft = { "clojure", "fennel", "scheme" }, - requires = { { "PaterJason/cmp-conjure", after = "conjure" } }, - config = function() - require("user.conjure").setup() - end, - }, - { - "rcarriga/vim-ultest", - requires = { { "vim-test/vim-test", after = "vim-ultest" } }, - cmd = { "Ultest", "UltestStop", "UltestClear", "UltestNearest", "UltestOutput" }, - run = ":UpdateRemotePlugins", - }, -} +-- Others +require "user.plugins" +require "user.keymaps"
D config/lvim/ftplugin/java.lua

@@ -1,22 +0,0 @@

-if vim.fn.has("mac") == 1 then - WORKSPACE_PATH = "/Users/" .. USER .. "/workspace/" -elseif vim.fn.has("unix") == 1 then - WORKSPACE_PATH = "/home/" .. USER .. "/workspace/" -else - print("Unsupported system") -end - -JAVA_LS_EXECUTABLE = os.getenv("HOME") .. "/.local/share/lunarvim/lvim/utils/bin/jdtls" - -require("jdtls").start_or_attach({ - on_attach = require("lsp").common_on_attach, - cmd = { JAVA_LS_EXECUTABLE, WORKSPACE_PATH .. vim.fn.fnamemodify(vim.fn.getcwd(), ":p:h:t") }, -}) - -vim.api.nvim_set_keymap("n", "<leader>la", ":lua require('jdtls').code_action()<CR>", { noremap = true, silent = true }) - -vim.cmd("command! -buffer JdtCompile lua require('jdtls').compile()") -vim.cmd("command! -buffer JdtUpdateConfig lua require('jdtls').update_project_config()") -vim.cmd("command! -buffer JdtJol lua require('jdtls').jol()") -vim.cmd("command! -buffer JdtBytecode lua require('jdtls').javap()") -vim.cmd("command! -buffer JdtJshell lua require('jdtls').jshell()")
D config/lvim/lsp-settings/jdtls.json

@@ -1,3 +0,0 @@

-{ - "java.format.enabled": true -}
M config/lvim/lsp-settings/yamlls.json

@@ -1,7 +1,6 @@

{ "yaml.schemas": { "https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json": ["docker-compose.yml", "docker-compose.yaml"], - "https://json.schemastore.org/ansible-playbook.json": ["*/playbook/**/*.yml", "*/playbooks/**/*.yml", "*/playbook/**/*.yaml", "*/playbooks/**/*.yaml", "ansible-playbook.yml"], "https://json.schemastore.org/yamllint.json": [".yamllint", ".yamllint.yml", ".yamllint.yaml"], "https://yarnpkg.com/configuration/yarnrc.json": [".yarnrc", ".yarnrc.yml"], "https://json.schemastore.org/github-action.json": ["*/.github/workflows/**/*.yml", "*/.github/workflows/**/*.yaml" ],
A config/lvim/lua/plug/lua-dev.lua

@@ -0,0 +1,12 @@

+local M = {} + +function M.setup() + local ok, lua_dev = pcall(require, "lua-dev") + if not ok then + return + end + + lua_dev.setup {} +end + +return M
A config/lvim/lua/plug/tabnine.lua

@@ -0,0 +1,16 @@

+local M = {} + +function M.setup() + local ok, tabnine = pcall(require, "cmp_tabnine.config") + if not ok then + return + end + + tabnine:setup { + max_lines = 1000, + max_num_results = 10, + sort = true, + } +end + +return M
A config/lvim/lua/plug/todo-comment.lua

@@ -0,0 +1,12 @@

+local M = {} + +function M.setup() + local ok, todo_comments = pcall(require, "todo-comments") + if not ok then + return + end + + todo_comments.setup {} +end + +return M
A config/lvim/lua/plug/ts-unit.lua

@@ -0,0 +1,14 @@

+local M = {} + +function M.setup() + local ok, ts_unit = pcall(require, "ts-unit") + if not ok then + return + end + + ts_unit.setup { + keymaps = true, + } +end + +return M
D config/lvim/lua/user/conjure.lua

@@ -1,16 +0,0 @@

-local M = {} - -M.setup = function() - vim.g.maplocalleader = "," - vim.g["conjure#mapping#doc_word"] = "K" - - -- Clojure - vim.g["conjure#client#clojure#nrepl#eval#auto_require"] = false - vim.g["conjure#client#clojure#nrepl#connection#auto_repl#enabled"] = false - - -- Scheme - vim.g["conjure#client#scheme#stdio#command"] = "chicken-csi -quiet -:c" - vim.g["conjure#client#scheme#stdio#prompt_pattern"] = "\n-#;%d-> " -end - -return M
M config/lvim/lua/user/dap-virtual-text.luaconfig/lvim/lua/plug/dap.lua

@@ -1,6 +1,7 @@

local M = {} -M.setup = function () +function M.setup() + -- Virtual text vim.g.dap_virtual_text = true end
A config/lvim/lua/user/keymaps.lua

@@ -0,0 +1,25 @@

+lvim.keys.normal_mode["<C-w>"] = "<cmd>BufferClose<cr>" +lvim.keys.normal_mode["<C-s>"] = "<cmd>w<cr>" +lvim.keys.visual_mode["jk"] = "<esc>" + +-- Which key +lvim.builtin.which_key.mappings.l.a = { "<cmd>Telescope lsp_code_actions<cr>", "Code Actions" } +lvim.builtin.which_key.mappings.l.d = { "<cmd>TroubleToggle<cr>", "Diagnostics" } +lvim.builtin.which_key.mappings.l.R = { "<cmd>TroubleToggle lsp_references<cr>", "References" } +lvim.builtin.which_key.mappings.s.P = { "<cmd>Telescope projects<cr>", "Projects" } +lvim.builtin.which_key.mappings["t"] = { + name = "Test", + t = { "<cmd>Ultest<cr>", "Run tests" }, + s = { "<cmd>UltestStop<cr>", "Stop tests" }, + c = { "<cmd>UltestClear<cr>", "Clear result" }, + n = { "<cmd>UltestNearest<cr>", "Run test" }, + o = { "<cmd>UltestOutput<cr>", "Show output" }, + j = { "<Plug>(ultest-next-fail)", "Next fail" }, + k = { "<Plug>(ultest-prev-fail)", "Prev fail" }, +} + +-- Beffers +local fmt = string.format +for i = 1, 9 do + lvim.keys.normal_mode[fmt("<A-%d>", i)] = fmt("<cmd>BufferGoto %d<cr>", i) +end
A config/lvim/lua/user/plugins.lua

@@ -0,0 +1,53 @@

+lvim.plugins = { + { "tpope/vim-surround", keys = { "c", "y", "d" }, event = "BufRead" }, + { "folke/trouble.nvim", cmd = "TroubleToggle" }, + { + "theHamsta/nvim-dap-virtual-text", + config = function() + require("plug.dap").setup() + end, + }, + { + "folke/todo-comments.nvim", + event = "BufRead", + config = function() + require "plug.todo-comment" + end, + }, + { + "tzachar/cmp-tabnine", + run = "./install.sh", + event = "InsertEnter", + config = function() + require "plug.tabnine" + end, + }, + { + "folke/lua-dev.nvim", + ft = "lua", + config = function() + require("plug.lua-dev").setup() + end, + }, + { + "Smirnov-O/ts-unit.nvim", + keys = { "vip", "cip", "yip", "dip" }, + config = function() + require "plug.ts-unit" + end, + }, + { + "rcarriga/vim-ultest", + requires = { + { "vim-test/vim-test", after = "vim-ultest" }, + }, + run = ":UpdateRemotePlugins", + cmd = { + "Ultest", + "UltestStop", + "UltestClear", + "UltestNearest", + "UltestOutput", + }, + }, +}
A config/lvim/selene.toml

@@ -0,0 +1,1 @@

+std="vim"
A config/lvim/stylua.toml

@@ -0,0 +1,6 @@

+column_width = 120 +line_endings = "Unix" +indent_type = "Spaces" +indent_width = 2 +quote_style = "AutoPreferDouble" +no_call_parentheses = true
A config/lvim/vim.toml

@@ -0,0 +1,9 @@

+[selene] +base = "lua52" +name = "vim" + +[vim] +any = true + +[lvim] +any = true