AstroNvim User Configuration#

User Configuration#

UIや機能などのMY設定を書き込む用のファイルの作成
ref: https://astronvim.com/Configuration/manage_user_config
GitHubのテンプレートAstroNvim/user_exampleを使用して,自分のリポジトリを名前 [astronvim_config] で作成する
作成したリポジトリを ~/.config/nvim/lua/user としてCloneする

$ git clone https://github.com/{username}/astronvim_config.git ~/.config/nvim/lua/user

user内の構造#

https://astronvim.com/Configuration/splitting_up

transparent#

背景を透明化する(透明化の強さは Terminal の設定に依存)
ref: AstroNvim/AstroNvim#8
user/highlight/init.lua のreturn内に以下の内容をコピー

  -- set highlight group for any theme
  -- the key is the name of the colorscheme or init
  -- the init key will apply to all colorschemes
  highlights = {
    -- apply highlight group to all colorschemes (include the default_theme)
    init = {
      -- set the transparency for all of these highlight groups
      Normal = { bg = "NONE", ctermbg = "NONE" },
      NormalNC = { bg = "NONE", ctermbg = "NONE" },
      CursorColumn = { cterm = {}, ctermbg = "NONE", ctermfg = "NONE" },
      CursorLine = { cterm = {}, ctermbg = "NONE", ctermfg = "NONE" },
      CursorLineNr = { cterm = {}, ctermbg = "NONE", ctermfg = "NONE" },
      LineNr = {},
      SignColumn = {},
      StatusLine = {},
      NeoTreeNormal = { bg = "NONE", ctermbg = "NONE" },
      NeoTreeNormalNC = { bg = "NONE", ctermbg = "NONE" },
    },
  },

n行のコードを選択して他の行に移動させる#

VScodeの alt + arrow と同じ機能
shift + v で1行分を範囲指定,j or k で上下移動してn行を範囲指定,shift + j or k で選択行を移動
ref: 数行のコードを選択して上下に移動したい

user/mapping.lua のreturn内に以下の内容をコピー

  v = {
    ["J"] = { ":move '>+1<CR>gv-gv", desc = "Move lines of code up" },
    ["K"] = { ":move '<-2<CR>gv-gv", desc = "Move lines of code down" },
  },