# AstroNvim User Configuration ## User Configuration UIや機能などのMY設定を書き込む用のファイルの作成 ref: [https://astronvim.com/Configuration/manage_user_config](https://astronvim.com/Configuration/manage_user_config) GitHubのテンプレート[https://github.com/AstroNvim/user_example](https://github.com/AstroNvim/user_example)を使用して,自分のリポジトリを名前 [astronvim_config] で作成する 作成したリポジトリを `~/.config/nvim/lua/user` としてCloneする ~~~bash $ git clone https://github.com/{username}/astronvim_config.git ~/.config/nvim/lua/user ~~~ ## user内の構造 [https://astronvim.com/Configuration/splitting_up](https://astronvim.com/Configuration/splitting_up) ## transparent 背景を透明化する(透明化の強さは Terminal の設定に依存) ref: [https://github.com/AstroNvim/AstroNvim/issues/8](https://github.com/AstroNvim/AstroNvim/issues/8) `user/highlight/init.lua` のreturn内に以下の内容をコピー ~~~lua -- 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: [数行のコードを選択して上下に移動したい](https://zenn.dev/convers39/articles/fd58ab494bbffb#%E6%95%B0%E8%A1%8C%E3%81%AE%E3%82%B3%E3%83%BC%E3%83%89%E3%82%92%E9%81%B8%E6%8A%9E%E3%81%97%E3%81%A6%E4%B8%8A%E4%B8%8B%E3%81%AB%E7%A7%BB%E5%8B%95%E3%81%97%E3%81%9F%E3%81%84) `user/mapping.lua` のreturn内に以下の内容をコピー ~~~lua v = { ["J"] = { ":move '>+1gv-gv", desc = "Move lines of code up" }, ["K"] = { ":move '<-2gv-gv", desc = "Move lines of code down" }, }, ~~~