all repos

dotfiles @ d1af927

i use rach linux btw
18 files changed, 302 insertions(+), 26 deletions(-)
Add lvim config and nvim
Author: Smirnov-O ss2316544@gmail.com
Committed at: 2021-09-11 15:59:44 +0300
Parent: 0b1ace5
A config/lvim/config.lua
···
        
        1
        +lvim.leader = "space"

      
        
        2
        +lvim.format_on_save = false

      
        
        3
        +lvim.lint_on_save = false

      
        
        4
        +lvim.colorscheme = "onedarker"

      
        
        5
        +

      
        
        6
        +-- Terminal

      
        
        7
        +lvim.builtin.terminal.active = true

      
        
        8
        +lvim.builtin.autopairs.active = true

      
        
        9
        +

      
        
        10
        +-- GitSigns

      
        
        11
        +lvim.builtin.gitsigns.opts.current_line_blame = true

      
        
        12
        +lvim.builtin.gitsigns.opts.current_line_blame_opts = { virt_text = true, virt_text_pos = "eol", delay = 200 }

      
        
        13
        +

      
        
        14
        +-- TreeSitter

      
        
        15
        +lvim.builtin.treesitter.ensure_installed = { "javascript", "typescript", "jsdoc", "lua", "java" }

      
        
        16
        +lvim.builtin.treesitter.indent.disable = { "clojure", "java", "python" }

      
        
        17
        +

      
        
        18
        +-- Telescope

      
        
        19
        +lvim.builtin.telescope.defaults.layout_config.prompt_position = "top"

      
        
        20
        +lvim.builtin.telescope.defaults.file_ignore_patterns = { ".git", "node_modules", "env" }

      
        
        21
        +

      
        
        22
        +-- Mappings

      
        
        23
        +lvim.keys.normal_mode["<C-w>"] = "<cmd>BufferClose<cr>"

      
        
        24
        +lvim.keys.normal_mode["<C-s>"] = "<cmd>w<cr>"

      
        
        25
        +lvim.builtin.which_key.mappings.l.d = { "<cmd>TroubleToggle<cr>", "Diagnostics" }

      
        
        26
        +lvim.builtin.which_key.mappings.l.R = { "<cmd>TroubleToggle lsp_references<cr>", "References" }

      
        
        27
        +

      
        
        28
        +local fmt = string.format

      
        
        29
        +for i = 1, 9 do

      
        
        30
        +	lvim.keys.normal_mode[fmt("<A-%d>", i)] = fmt("<cmd>BufferGoto %d<cr>", i)

      
        
        31
        +end

      
        
        32
        +

      
        
        33
        +-- Plugins

      
        
        34
        +lvim.plugins = {

      
        
        35
        +	{ "tpope/vim-surround", keys = { "c", "y", "d" } },

      
        
        36
        +	{ "andymass/vim-matchup", keys = { "%" } },

      
        
        37
        +	{ "tzachar/cmp-tabnine", run = "./install.sh", event = "InsertEnter" },

      
        
        38
        +	{ "folke/trouble.nvim", cmd = { "TroubleToggle" } },

      
        
        39
        +	{ "folke/todo-comments.nvim", event = "BufRead" },

      
        
        40
        +	{ "mfussenegger/nvim-jdtls", ft = { "java" } },

      
        
        41
        +	{ "npxbr/glow.nvim", ft = { "markdown" }, cmd = { "Glow" } },

      
        
        42
        +}

      
A config/lvim/ftplugin/go.lua
···
        
        1
        +lvim.format_on_save = true

      
        
        2
        +lvim.lang.go.formatters = {

      
        
        3
        +	{ exe = "gofmt" },

      
        
        4
        +	{ exe = "goimports" },

      
        
        5
        +}

      
A config/lvim/ftplugin/java.lua
···
        
        1
        +if vim.fn.has("mac") == 1 then

      
        
        2
        +	WORKSPACE_PATH = "/Users/" .. USER .. "/workspace/"

      
        
        3
        +elseif vim.fn.has("unix") == 1 then

      
        
        4
        +	WORKSPACE_PATH = "/home/" .. USER .. "/workspace/"

      
        
        5
        +else

      
        
        6
        +	print("Unsupported system")

      
        
        7
        +end

      
        
        8
        +

      
        
        9
        +JAVA_LS_EXECUTABLE = os.getenv("HOME") .. "/.local/share/lunarvim/lvim/utils/bin/jdtls"

      
        
        10
        +

      
        
        11
        +require("jdtls").start_or_attach({

      
        
        12
        +	on_attach = require("lsp").common_on_attach,

      
        
        13
        +	cmd = { JAVA_LS_EXECUTABLE, WORKSPACE_PATH .. vim.fn.fnamemodify(vim.fn.getcwd(), ":p:h:t") },

      
        
        14
        +})

      
        
        15
        +

      
        
        16
        +vim.api.nvim_set_keymap("n", "<leader>la", ":lua require('jdtls').code_action()<CR>", { noremap = true, silent = true })

      
        
        17
        +

      
        
        18
        +vim.cmd("command! -buffer JdtCompile lua require('jdtls').compile()")

      
        
        19
        +vim.cmd("command! -buffer JdtUpdateConfig lua require('jdtls').update_project_config()")

      
        
        20
        +vim.cmd("command! -buffer JdtJol lua require('jdtls').jol()")

      
        
        21
        +vim.cmd("command! -buffer JdtBytecode lua require('jdtls').javap()")

      
        
        22
        +vim.cmd("command! -buffer JdtJshell lua require('jdtls').jshell()")

      
A config/lvim/ftplugin/javascript.lua
···
        
        1
        +lvim.lang.javascript.formatters = {

      
        
        2
        +	-- { exe = "eslint_d" },

      
        
        3
        +	{ exe = "prettierd" },

      
        
        4
        +}

      
        
        5
        +

      
        
        6
        +lvim.lang.javascript.linters = {

      
        
        7
        +	{ exe = "eslint_d" },

      
        
        8
        +}

      
        
        9
        +

      
        
        10
        +lvim.lang.javascript.lsp.setup.handlers = {

      
        
        11
        +	["textDocument/publishDiagnostics"] = function(_, _, p, client_id, _, config)

      
        
        12
        +		if p.diagnostics ~= nil then

      
        
        13
        +			local i = 1

      
        
        14
        +			while i <= #p.diagnostics do

      
        
        15
        +				if p.diagnostics[i].code == 80001 then

      
        
        16
        +					table.remove(p.diagnostics, i)

      
        
        17
        +				else

      
        
        18
        +					i = i + 1

      
        
        19
        +				end

      
        
        20
        +			end

      
        
        21
        +		end

      
        
        22
        +		vim.lsp.diagnostic.on_publish_diagnostics(_, _, p, client_id, _, config)

      
        
        23
        +	end,

      
        
        24
        +}

      
A config/lvim/ftplugin/lua.lua
···
        
        1
        +lvim.format_on_save = true

      
        
        2
        +lvim.lang.lua.formatters = {

      
        
        3
        +	{ exe = "stylua" },

      
        
        4
        +}

      
        
        5
        +

      
        
        6
        +lvim.lang.lua.linters = {

      
        
        7
        +	-- { exe = "luacheck" },

      
        
        8
        +	-- { exe = "selene" },

      
        
        9
        +}

      
A config/lvim/ftplugin/python.lua
···
        
        1
        +lvim.format_on_save = true

      
        
        2
        +lvim.lang.python.formatters = {

      
        
        3
        +	{ exe = "black" },

      
        
        4
        +	{ exe = "isort" },

      
        
        5
        +}

      
        
        6
        +

      
        
        7
        +lvim.lang.python.linters = {

      
        
        8
        +	{ exe = "flake8" },

      
        
        9
        +}

      
A config/lvim/ftplugin/typescript.lua
···
        
        1
        +lvim.lang.typescript.formatters = {

      
        
        2
        +	-- { exe = "eslint_d" },

      
        
        3
        +	{ exe = "prettierd" },

      
        
        4
        +}

      
        
        5
        +

      
        
        6
        +lvim.lang.typescript.linters = {

      
        
        7
        +	{ exe = "eslint_d" },

      
        
        8
        +}

      
A config/lvim/lsp-settings/jdtls.json
···
        
        1
        +{

      
        
        2
        +  "java.format.enabled": true

      
        
        3
        +}

      
A config/lvim/lsp-settings/jsonls.json
···
        
        1
        +{

      
        
        2
        +  "json.schemas": [

      
        
        3
        +    {

      
        
        4
        +      "fileMatch": [

      
        
        5
        +        "package.json"

      
        
        6
        +      ],

      
        
        7
        +      "url": "https://json.schemastore.org/package.json"

      
        
        8
        +    },

      
        
        9
        +    {

      
        
        10
        +      "fileMatch": [

      
        
        11
        +        "tsconfig.json",

      
        
        12
        +        "tsconfig.*.json"

      
        
        13
        +      ],

      
        
        14
        +      "url": "http://json.schemastore.org/tsconfig"

      
        
        15
        +    },

      
        
        16
        +    {

      
        
        17
        +      "fileMatch": [

      
        
        18
        +        "lerna.json"

      
        
        19
        +      ],

      
        
        20
        +      "url": "http://json.schemastore.org/lerna"

      
        
        21
        +    },

      
        
        22
        +    {

      
        
        23
        +      "fileMatch": [

      
        
        24
        +        ".babelrc.json",

      
        
        25
        +        ".babelrc",

      
        
        26
        +        "babel.config.json"

      
        
        27
        +      ],

      
        
        28
        +      "url": "http://json.schemastore.org/lerna"

      
        
        29
        +    },

      
        
        30
        +    {

      
        
        31
        +      "fileMatch": [

      
        
        32
        +        ".eslintrc.json",

      
        
        33
        +        ".eslintrc"

      
        
        34
        +      ],

      
        
        35
        +      "url": "http://json.schemastore.org/eslintrc"

      
        
        36
        +    },

      
        
        37
        +    {

      
        
        38
        +      "fileMatch": [

      
        
        39
        +        "bsconfig.json"

      
        
        40
        +      ],

      
        
        41
        +      "url": "https://bucklescript.github.io/bucklescript/docson/build-schema.json"

      
        
        42
        +    },

      
        
        43
        +    {

      
        
        44
        +      "fileMatch": [

      
        
        45
        +        ".prettierrc",

      
        
        46
        +        ".prettierrc.json",

      
        
        47
        +        "prettier.config.json"

      
        
        48
        +      ],

      
        
        49
        +      "url": "http://json.schemastore.org/prettierrc"

      
        
        50
        +    },

      
        
        51
        +    {

      
        
        52
        +      "fileMatch": [

      
        
        53
        +        "now.json"

      
        
        54
        +      ],

      
        
        55
        +      "url": "http://json.schemastore.org/now"

      
        
        56
        +    },

      
        
        57
        +    {

      
        
        58
        +      "fileMatch": [

      
        
        59
        +        "openapi.json",

      
        
        60
        +        "swagger.json"

      
        
        61
        +      ],

      
        
        62
        +      "url": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.1/schema.json"

      
        
        63
        +    },

      
        
        64
        +    {

      
        
        65
        +      "fileMatch": [

      
        
        66
        +        "nest-cli.json"

      
        
        67
        +      ],

      
        
        68
        +      "url": "https://json.schemastore.org/nest-cli.json"

      
        
        69
        +    },

      
        
        70
        +    {

      
        
        71
        +      "fileMatch": [

      
        
        72
        +        "nodemon.json"

      
        
        73
        +      ],

      
        
        74
        +      "url": "https://json.schemastore.org/nodemon.json"

      
        
        75
        +    }

      
        
        76
        +  ]

      
        
        77
        +}

      
A config/lvim/lsp-settings/pyright.json
···
        
        1
        +{

      
        
        2
        +  "python.analysis.typeCheckingMode": "off"

      
        
        3
        +}

      
A config/lvim/lsp-settings/yamlls.json
···
        
        1
        +{

      
        
        2
        +  "yaml.schemas": {

      
        
        3
        +    "https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json": [

      
        
        4
        +      "docker-compose.yml",

      
        
        5
        +      "docker-compose.yaml"

      
        
        6
        +    ],

      
        
        7
        +    "https://json.schemastore.org/ansible-playbook.json": [

      
        
        8
        +      "*/playbook/**/*.yml",

      
        
        9
        +      "*/playbooks/**/*.yml",

      
        
        10
        +      "*/playbook/**/*.yaml",

      
        
        11
        +      "*/playbooks/**/*.yaml"

      
        
        12
        +    ],

      
        
        13
        +    "https://json.schemastore.org/yamllint.json": [

      
        
        14
        +      ".yamllint",

      
        
        15
        +      ".yamllint.yml",

      
        
        16
        +      ".yamllint.yaml"

      
        
        17
        +    ],

      
        
        18
        +    "https://yarnpkg.com/configuration/yarnrc.json": [

      
        
        19
        +      ".yarnrc",

      
        
        20
        +      ".yarnrc.yml"

      
        
        21
        +    ],

      
        
        22
        +    "https://json.schemastore.org/github-action.json": [

      
        
        23
        +      "*/.github/workflows/**/*.yml",

      
        
        24
        +      "*/.github/workflows/**/*.yaml"

      
        
        25
        +    ],

      
        
        26
        +    "https://json.schemastore.org/gitlab-ci.json": [

      
        
        27
        +      ".gitlab-ci.yml"

      
        
        28
        +    ],

      
        
        29
        +    "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.1/schema.json": [

      
        
        30
        +      "openapi.yaml",

      
        
        31
        +      "openapi.yml",

      
        
        32
        +      "swagger.yml",

      
        
        33
        +      "swagger.yal"

      
        
        34
        +    ]

      
        
        35
        +  }

      
        
        36
        +}

      
A config/lvim/lua/u/conjure.lua
···
        
        1
        +local M = {}

      
        
        2
        +

      
        
        3
        +M.config = function ()

      
        
        4
        +  vim.cmd [[ let maplocalleader = "," ]]

      
        
        5
        +end

      
        
        6
        +

      
        
        7
        +return M

      
A config/lvim/lua/u/package-info.lua
···
        
        1
        +local M = {}

      
        
        2
        +

      
        
        3
        +M.config = function()

      
        
        4
        +	require("package-info").setup({{

      
        
        5
        +    autostart = true,

      
        
        6
        +    colors = { up_to_date = "#3C4048", outdated = "#6ec0fa" },

      
        
        7
        +    icons = {

      
        
        8
        +      enable = true,

      
        
        9
        +      style = { up_to_date = "|  ", outdated = "|  " },

      
        
        10
        +    },

      
        
        11
        +	}})

      
        
        12
        +end

      
        
        13
        +

      
        
        14
        +return M

      
A config/nvim/init.lua
···
        
        1
        +local pack_path = vim.fn.stdpath("data") .. "/site/pack"

      
        
        2
        +local fmt = string.format

      
        
        3
        +

      
        
        4
        +local function ensure(user, repo)

      
        
        5
        +	local install_path = fmt("%s/packer/start/%s", pack_path, repo, repo)

      
        
        6
        +	if vim.fn.empty(vim.fn.glob(install_path)) > 0 then

      
        
        7
        +		vim.api.nvim_command(fmt("!git clone https://github.com/%s/%s %s", user, repo, install_path))

      
        
        8
        +		vim.api.nvim_command(fmt("packadd %s", repo))

      
        
        9
        +	end

      
        
        10
        +end

      
        
        11
        +

      
        
        12
        +ensure("wbthomason", "packer.nvim")

      
        
        13
        +ensure("Olical", "aniseed")

      
        
        14
        +

      
        
        15
        +vim.g["aniseed#env"] = {

      
        
        16
        +	module = "config.init",

      
        
        17
        +	compile = true,

      
        
        18
        +}

      
M config/rofi/config
···
        1
        
        -rofi.theme: nten-light

      
        
        1
        +rofi.theme: nten

      
        2
        2
         rofi.font: Jetbarains Mono 12

      
        3
        3
         rofi.auto-select: false

      
        4
        4
         rofi.hide-scrollbar: true

      
M config/rofi/script/powermenu.sh
···
        1
        1
         #!/usr/bin/env bash

      
        2
        2
         declare options=("ShutDown\nLogOut\nReboot")

      
        3
        
        -rofitheme="nten-light-dmenu"

      
        
        3
        +rofitheme="nten-dmenu"

      
        4
        4
         choice=$(echo -e ${options[@]} | rofi -dmenu -p "Power" -theme $rofitheme)

      
        5
        5
         

      
        6
        6
         case $choice in

      
M vscode/settings.json
···
        1
        1
         {

      
        2
        2
           "workbench.iconTheme": "material-icon-theme",

      
        3
        
        -  "workbench.colorTheme": "GitHub Light",

      
        
        3
        +  "workbench.colorTheme": "GitHub Dark Default",

      
        4
        4
           "workbench.sideBar.location": "right",

      
        5
        5
           "workbench.editor.untitled.hint": "hidden",

      
        6
        6
           "workbench.startupEditor": "none",

      
        7
        
        -  "workbench.panel.defaultLocation": "left",

      
        
        7
        +  "workbench.panel.defaultLocation": "bottom",

      
        8
        8
           "workbench.activityBar.visible": false,

      
        
        9
        +  "window.menuBarVisibility": "toggle",

      
        9
        10
           "update.showReleaseNotes": false,

      
        10
        11
           // Editor

      
        11
        12
           // "editor.cursorSmoothCaretAnimation": true,

      ···
        23
        24
           "editor.fontSize": 14,

      
        24
        25
           "editor.tabSize": 4,

      
        25
        26
           // Files

      
        26
        
        -  "explorer.compactFolders": false,

      
        
        27
        +  "explorer.compactFolders": true,

      
        27
        28
           "explorer.confirmDragAndDrop": false,

      
        28
        29
           "explorer.confirmDelete": false,

      
        29
        30
           "files.insertFinalNewline": false,

      ···
        31
        32
           "files.trimTrailingWhitespace": false,

      
        32
        33
           "files.exclude": {

      
        33
        34
             "**/node_modules": true,

      
        34
        
        -    "**/env": true

      
        
        35
        +    "**/env": true,

      
        
        36
        +    "**/.classpath": true,

      
        
        37
        +    "**/.project": true,

      
        
        38
        +    "**/.settings": true,

      
        
        39
        +    "**/.factorypath": true

      
        35
        40
           },

      
        36
        41
           // Git

      
        37
        42
           "gitlens.codeLens.enabled": true,

      
        38
        43
           "git.autofetch": true,

      
        39
        44
           "git.confirmSync": false,

      
        40
        45
           "git.enableSmartCommit": true,

      
        41
        
        -  // Vim

      
        42
        
        -  "vim.easymotion": true,

      
        43
        
        -  "vim.surround": true,

      
        44
        
        -  "vim.useSystemClipboard": true,

      
        45
        
        -  "vim.hlsearch": true,

      
        46
        
        -  "vim.incsearch": true,

      
        47
        
        -  "vim.leader": ";",

      
        48
        
        -  "vim.normalModeKeyBindings": [

      
        49
        
        -    {"before": ["<space>"], "commands": [":nohl"]},

      
        50
        
        -  ],

      
        51
        
        -  "vim.insertModeKeyBindings": [

      
        52
        
        -    {"before": ["j", "k"], "after": ["<esc>"]}

      
        53
        
        -  ],

      
        54
        
        -  "vim.handleKeys": { "<C-w>": false, "<C-b>": false, "<C-n>": false, "<C-h>": false},

      
        55
        
        -  // Expensions

      
        56
        46
           "terminal.integrated.tabs.enabled": false,

      
        
        47
        +  // Extensions

      
        57
        48
           "extensions.ignoreRecommendations": true,

      
        58
        49
           "docker.showStartPage": false,

      
        59
        
        -  // "prettier.semi": false,

      
        
        50
        +  "calva.myCljAliases": [

      
        
        51
        +    "nREPL",

      
        
        52
        +    "nrepl",

      
        
        53
        +    "test"

      
        
        54
        +  ],

      
        
        55
        +  "calva.paredit.defaultKeyMap": "strict",

      
        60
        56
           // Languages

      
        61
        57
           "javascript.suggestionActions.enabled": false,

      
        62
        58
           "typescript.suggestionActions.enabled": false,

      ···
        66
        62
           },

      
        67
        63
           "[typescript]": {

      
        68
        64
             "editor.defaultFormatter": "esbenp.prettier-vscode"

      
        69
        
        -  },

      
        70
        
        -  "window.menuBarVisibility": "toggle"

      
        71
        
        -

      
        72
        
        -}
      
        
        65
        +  }

      
        
        66
        +}

      
M zshrc
···
        17
        17
         ## FNM

      
        18
        18
         eval $(fnm env)

      
        19
        19
         

      
        
        20
        +## Functions

      
        
        21
        +dotnet() {

      
        
        22
        +  $HOME/dotnet/dotnet "$@"

      
        
        23
        +}

      
        
        24
        +

      
        20
        25
         ## Aliases

      
        21
        26
         alias cls="clear" cp="cp -r" mkdir="mkdir -p" open="open_command" lg="lazygit"

      
        22
        27
         alias lv="lvim" vim="lvim"