Open17

nvimの設定の記録

108えん108えん

macはちゃんと表示されるけど、windowsのpowershellで表示が崩れる

108えん108えん

めんどいので英語にした。(直った)

AppData/Roaming/lazygit/config.yml
gui:
  language: "en"
  theme:
    selectedLineBgColor:
      - "#192f60"
108えん108えん

行表示を普通の行表示に変えた。
あと、saveがファイルごとだったのでctl-sで全部保存にした。
vs codeの自動保存に慣れすぎていて、保存を忘れてしまう。

init.lua
vim.wo.relativenumber = false
mappings.lua
maps.n["<C-s>"] = { "<cmd>wa!<cr>", desc = "Force write" }
108えん108えん

autosaveのプラグインを入れてみた。

plugin/auto-save.lua
return {
  "pocco81/auto-save.nvim",
  event = {"InsertLeave", "BufLeave", "FocusLost", "TextChanged"}
}
108えん108えん

saveされまくってウザいからevent変えてみたけどなんか反映されてなさそう

108えん108えん

todoコメントとかのハイライト機能を入れてみた

return {
  "folke/todo-comments.nvim",
  dependencies = {
    "nvim-lua/plenary.nvim",
  },
  event = "User Astrofile",
  config = function()
    require("todo-comments").setup()
  end,
}
108えん108えん
108えん108えん

追加した

git:
  branchLogCmd: "git log --graph --color=always --abbrev-commit --date=format:'%Y/%m/%d %H:%M' --pretty=format:'%C(red)%d%Creset%C(white)%h%Creset %C(green) %an %Creset %C(cyan)%ad%Creset %C(white bold)%w(80)%s%Creset%w(80,2,2)%b' {{branchName}} --"
108えん108えん

設定をすべて移動した。

user/init.lua
return {
  colorscheme = "catppuccin",
  options = {
    opt = {
      relativenumber = false,
      number = true,
    }
  },
  plugins = {
    {
      "lewis6991/gitsigns.nvim",
      opts = {
        current_line_blame = true,
        current_line_blame_opts = {
          delay = 200,
          virt_text_pos = "eol"
        }
      },
    },
    {
      "folke/todo-comments.nvim",
      dependencies = {
        "nvim-lua/plenary.nvim",
      },
      event = "User Astrofile",
      config = function()
        require("todo-comments").setup()
      end,
    },
    {
      "tpope/vim-fugitive",
      cmd="Git"
    },
    {
      "catppuccin/nvim",
      name = "catppuccin",
      opts = {
        -- configuration options...
        flavour = "Macchiato",
        transparent_background = true
      },
    }
  },
  mappings = {
    n = {
      ["<C-s>"] = { "<cmd>wa!<cr>", desc = "Force write" }
    }
  }
}
108えん108えん

lazygitのthemeを変更

https://github.com/catppuccin/lazygit/tree/main/themes

config.yml
gui:
  language: "en"
  theme:
    activeBorderColor:
      - "#8aadf4"
      - bold
    inactiveBorderColor:
      - "#a5adcb"
    optionsTextColor:
      - "#8aadf4"
    selectedLineBgColor:
      - "#363a4f"
    cherryPickedCommitBgColor:
      - "#494d64"
    cherryPickedCommitFgColor:
      - "#8aadf4"
    unstagedChangesColor:
      - "#ed8796"
    defaultFgColor:
      - "#cad3f5"
    searchingActiveBorderColor:
      - "#eed49f"
  nerdFontsVersion: "3"
git:
  branchLogCmd: "git log --graph --color=always --abbrev-commit --date=format:'%Y/%m/%d %H:%M' --pretty=format:'%C(#ed8796)%d%Creset%C(#cad3f5)%h%Creset %C(#a6da95) %an %Creset %C(#8aadf4)%ad%Creset %C(#cad3f5 bold)%w(80)%s%Creset%w(80,2,2)%b' {{branchName}} --"
108えん108えん

mappingを結構変えた

user/init.lua
  mappings = {
    n = {
      ["<C-s>"] = { "<cmd>wa!<cr>", desc = "Force write" },
      ["<C-p>"] = { '<Cmd>execute v:count . "ToggleTerm"<CR>', desc = "Toggle terminal" },
      ["<C-o>"] = {
         function()
          require("astronvim.utils.buffer").nav(vim.v.count > 0 and vim.v.count or 1)
        end,
        desc = "Next buffer"
      },
      ["<C-i>"] = {
        function()
          require("astronvim.utils.buffer").nav(-(vim.v.count > 0 and vim.v.count or 1))
        end,
        desc = "Previous buffer",
      },
      ["<C-g>"] = {
        function()
          local utils = require "astronvim.utils"
          local worktree = require("astronvim.utils.git").file_worktree()
          local flags = worktree and (" --work-tree=%s --git-dir=%s"):format(worktree.toplevel, worktree.gitdir) or ""
          utils.toggle_term_cmd("lazygit " .. flags)
        end,
        desc = "ToggleTerm lazygit",
      }
    },
    t = {
      ["<C-p>"] = { '<Cmd>execute v:count . "ToggleTerm"<CR>', desc = "Toggle terminal" }
    }
  }
108えん108えん

hlchunkを入れた

init.lua
    {
      "shellRaining/hlchunk.nvim",
      event = { "UIEnter" },
      config = function()
        require("hlchunk").setup({})
      end
    }