Skip to content

Commit

Permalink
[zellij] デフォルトを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
nomutin committed Jul 27, 2024
1 parent 8075a22 commit 4929db7
Show file tree
Hide file tree
Showing 7 changed files with 146 additions and 212 deletions.
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_size = 4
indent_style = space

[*.lua]
indent_style = space
Expand Down
2 changes: 1 addition & 1 deletion xdg_config/alacritty/alacritty.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ white = '#ECEFF4'

[keyboard]
bindings = [
{ key = "f", mods = "Control", action = "ToggleViMode" }
{ key = ".", mods = "Control", action = "ToggleViMode" }
]
20 changes: 14 additions & 6 deletions xdg_config/git/config
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[user]
name = nomutin
email = [email protected]
name = nomutin
email = [email protected]
[core]
editor = nvim
[diff]
tool = vimdiff
[difftool]
prompt = false
[difftool "vimdiff"]
cmd = nvim -d $LOCAL $BASE -c '$wincmd w' -c 'wincmd J'
30 changes: 21 additions & 9 deletions xdg_config/nvim/init.lua
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
-- Minimalist neovim configuration by @nomutin

-- ====== OPTIONS ======
-- ====== BUILTIN ======
vim.loader.enable()
vim.g.mapleader = " "

vim.g.netrw_banner = 0
vim.g.netrw_liststyle = 3
vim.g.netrw_browse_split = 4
vim.g.showhide = 1
vim.g.netrw_altv = 1
vim.g.netrw_winsize = -28
vim.g.netrw_keepdir = 1
vim.g.netrw_preview = 1

vim.opt.title = true
vim.opt.termguicolors = true
vim.opt.clipboard = "unnamedplus"
Expand All @@ -29,15 +32,11 @@ vim.opt.scrolloff = 8
vim.opt.sidescrolloff = 8
vim.opt.laststatus = 3
vim.opt.list = true
vim.api.nvim_set_hl(0, "Function", { fg = "NvimLightBlue" })

-- ====== KEYMAP ======
vim.api.nvim_set_hl(0, "Function", { fg = "NvimLightBlue" })
vim.keymap.set("i", "jk", "<ESC>", { desc = "Return to normal mode" })
vim.keymap.set("t", "fd", [[<C-\><C-n>]], { desc = "Return to normal mode" })
vim.keymap.set("t", "fd", [[<C-\><C-n>]])
vim.keymap.set("n", "<leader>n", "<cmd>Lexplore<cr>", { desc = "Open file explorer" })
vim.keymap.set("n", "<leader>e", "<cmd>Telescope find_files<cr>", { desc = "Find files" })
vim.keymap.set({ "n", "x", "o" }, "s", "<cmd>lua require('flash').jump()<cr>", { desc = "Jump" })
vim.keymap.set({ "n", "x", "o" }, "S", "<cmd>lua require('flash').treesitter()<cr>", { desc = "Select" })

-- ====== PLUGIN ======
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
Expand All @@ -49,7 +48,13 @@ vim.opt.rtp:prepend(lazypath)

require("lazy").setup({
{ "github/copilot.vim", event = "BufRead" },
{ "folke/flash.nvim" },
{
"folke/flash.nvim",
keys = {
{ "s", mode = { "n", "x", "o" }, "<cmd>lua require('flash').jump()<cr>", desc = "Flash" },
{ "S", mode = { "n", "x", "o" }, "<cmd>lua require('flash').treesitter()<cr>", desc = "Flash Treesitter" },
},
},
{ "lewis6991/gitsigns.nvim", event = "BufRead", opts = {} },
{ "nvim-lualine/lualine.nvim", event = "BufRead", opts = {} },
{
Expand Down Expand Up @@ -84,6 +89,13 @@ require("lazy").setup({
main = "nvim-treesitter.configs",
opts = { highlight = { enable = true }, indent = { enable = true } },
},
{ "nvim-telescope/telescope.nvim", dependencies = { "nvim-lua/plenary.nvim" } },
{
"nvim-telescope/telescope.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
keys = {
{ "<leader>f", "<cmd>Telescope find_files<cr>", { desc = "Find files" } },
{ "<leader>g", "<cmd>Telescope live_grep<cr>", { desc = "Live Grep" } },
},
},
defaults = { lazy = true },
})
230 changes: 34 additions & 196 deletions xdg_config/zellij/config.kdl
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ keybinds {
bind "b" { BreakPane; SwitchToMode "Normal"; }
bind "]" { BreakPaneRight; SwitchToMode "Normal"; }
bind "[" { BreakPaneLeft; SwitchToMode "Normal"; }
bind "1" { GoToTab 1; SwitchToMode "Normal"; }
bind "2" { GoToTab 2; SwitchToMode "Normal"; }
bind "3" { GoToTab 3; SwitchToMode "Normal"; }
bind "4" { GoToTab 4; SwitchToMode "Normal"; }
bind "5" { GoToTab 5; SwitchToMode "Normal"; }
bind "6" { GoToTab 6; SwitchToMode "Normal"; }
bind "7" { GoToTab 7; SwitchToMode "Normal"; }
bind "8" { GoToTab 8; SwitchToMode "Normal"; }
bind "9" { GoToTab 9; SwitchToMode "Normal"; }
// bind "1" { GoToTab 1; SwitchToMode "Normal"; }
// bind "2" { GoToTab 2; SwitchToMode "Normal"; }
// bind "3" { GoToTab 3; SwitchToMode "Normal"; }
// bind "4" { GoToTab 4; SwitchToMode "Normal"; }
// bind "5" { GoToTab 5; SwitchToMode "Normal"; }
// bind "6" { GoToTab 6; SwitchToMode "Normal"; }
// bind "7" { GoToTab 7; SwitchToMode "Normal"; }
// bind "8" { GoToTab 8; SwitchToMode "Normal"; }
// bind "9" { GoToTab 9; SwitchToMode "Normal"; }
bind "Tab" { ToggleTab; }
}
scroll {
Expand Down Expand Up @@ -146,18 +146,18 @@ keybinds {
}
shared_except "locked" {
bind "Ctrl g" { SwitchToMode "Locked"; }
bind "Ctrl q" { Quit; }
bind "Alt n" { NewPane; }
bind "Alt i" { MoveTab "Left"; }
bind "Alt o" { MoveTab "Right"; }
bind "Alt h" "Alt Left" { MoveFocusOrTab "Left"; }
bind "Alt l" "Alt Right" { MoveFocusOrTab "Right"; }
bind "Alt j" "Alt Down" { MoveFocus "Down"; }
bind "Alt k" "Alt Up" { MoveFocus "Up"; }
bind "Alt =" "Alt +" { Resize "Increase"; }
bind "Alt -" { Resize "Decrease"; }
bind "Alt [" { PreviousSwapLayout; }
bind "Alt ]" { NextSwapLayout; }
// bind "Ctrl q" { Quit; }
// bind "Alt n" { NewPane; }
// bind "Alt i" { MoveTab "Left"; }
// bind "Alt o" { MoveTab "Right"; }
// bind "Alt h" "Alt Left" { MoveFocusOrTab "Left"; }
// bind "Alt l" "Alt Right" { MoveFocusOrTab "Right"; }
// bind "Alt j" "Alt Down" { MoveFocus "Down"; }
// bind "Alt k" "Alt Up" { MoveFocus "Up"; }
// bind "Alt =" "Alt +" { Resize "Increase"; }
// bind "Alt -" { Resize "Decrease"; }
// bind "Alt [" { PreviousSwapLayout; }
// bind "Alt ]" { NextSwapLayout; }
}
shared_except "normal" "locked" {
bind "Enter" "Esc" { SwitchToMode "Normal"; }
Expand Down Expand Up @@ -199,185 +199,23 @@ plugins {
}
}

// Choose what to do when zellij receives SIGTERM, SIGINT, SIGQUIT or SIGHUP
// eg. when terminal window with an active zellij session is closed
// Options:
// - detach (Default)
// - quit
//
// on_force_close "quit"

// Send a request for a simplified ui (without arrow fonts) to plugins
// Options:
// - true
// - false (Default)
//
simplified_ui true

// Choose the path to the default shell that zellij will use for opening new panes
// Default: $SHELL
//
// default_shell "fish"

// Choose the path to override cwd that zellij will use for opening new panes
//
// default_cwd ""

// Toggle between having pane frames around the panes
// Options:
// - true (default)
// - false
//
// pane_frames true

// Toggle between having Zellij lay out panes according to a predefined set of layouts whenever possible
// Options:
// - true (default)
// - false
//
// auto_layout true

// Whether sessions should be serialized to the cache folder (including their tabs/panes, cwds and running commands) so that they can later be resurrected
// Options:
// - true (default)
// - false
//
// session_serialization false

// Whether pane viewports are serialized along with the session, default is false
// Options:
// - true
// - false (default)
// serialize_pane_viewport true

// Scrollback lines to serialize along with the pane viewport when serializing sessions, 0
// defaults to the scrollback size. If this number is higher than the scrollback size, it will
// also default to the scrollback size. This does nothing if `serialize_pane_viewport` is not true.
//
// scrollback_lines_to_serialize 10000

// Define color themes for Zellij
// For more examples, see: https://github.com/zellij-org/zellij/tree/main/example/themes
// Once these themes are defined, one of them should to be selected in the "theme" section of this file
//
// themes {
// dracula {
// fg 248 248 242
// bg 40 42 54
// red 255 85 85
// green 80 250 123
// yellow 241 250 140
// blue 98 114 164
// magenta 255 121 198
// orange 255 184 108
// cyan 139 233 253
// black 0 0 0
// white 255 255 255
// }
// }

themes {
nord_me {
fg 216 222 233 // #D8DEE9
bg 46 52 64 // #2E3440
black 59 66 82 // #3B4252
red 191 97 106 // #BF616A
my_nord {
fg 216 222 233
bg 46 52 64
black 59 66 82
red 191 97 106
green "#89b4fa"
yellow 235 203 139 // #EBCB8B
blue 129 161 193 // #81A1C1
magenta 180 142 173 // #B48EAD
cyan 136 192 208 // #88C0D0
white 229 233 240 // #E5E9F0
orange 208 135 112 // #D08770
yellow 235 203 139
blue 129 161 193
magenta 180 142 173
cyan 136 192 208
white 229 233 240
orange 208 135 112
}
}

// Choose the theme that is specified in the themes section.
// Default: default
//
theme "nord_me"


// The name of the default layout to load on startup
// Default: "default"
//
default_layout "compact"

// Choose the mode that zellij uses when starting up.
// Default: normal
//
// default_mode "locked"

// Toggle enabling the mouse mode.
// On certain configurations, or terminals this could
// potentially interfere with copying text.
// Options:
// - true (default)
// - false
//
// mouse_mode false

// Configure the scroll back buffer size
// This is the number of lines zellij stores for each pane in the scroll back
// buffer. Excess number of lines are discarded in a FIFO fashion.
// Valid values: positive integers
// Default value: 10000
//
// scroll_buffer_size 10000

// Provide a command to execute when copying text. The text will be piped to
// the stdin of the program to perform the copy. This can be used with
// terminal emulators which do not support the OSC 52 ANSI control sequence
// that will be used by default if this option is not set.
// Examples:
//
// copy_command "xclip -selection clipboard" // x11
// copy_command "wl-copy" // wayland
// copy_command "pbcopy" // osx

// Choose the destination for copied text
// Allows using the primary selection buffer (on x11/wayland) instead of the system clipboard.
// Does not apply when using copy_command.
// Options:
// - system (default)
// - primary
//
// copy_clipboard "primary"

// Enable or disable automatic copy (and clear) of selection when releasing mouse
// Default: true
//
// copy_on_select false

// Path to the default editor to use to edit pane scrollbuffer
// Default: $EDITOR or $VISUAL
//
// scrollback_editor "/usr/bin/vim"

// When attaching to an existing session with other users,
// should the session be mirrored (true)
// or should each user have their own cursor (false)
// Default: false
//
// mirror_session true

// The folder in which Zellij will look for layouts
//
// layout_dir "/path/to/my/layout_dir"

// The folder in which Zellij will look for themes
//
// theme_dir "/path/to/my/theme_dir"

// Enable or disable the rendering of styled and colored underlines (undercurl).
// May need to be disabled for certain unsupported terminals
// Default: true
//
// styled_underlines false

// Enable or disable writing of session metadata to disk (if disabled, other sessions might not know
// metadata info on this session)
// Default: false
//
// disable_session_metadata true

theme "my_nord"
default_layout "my-default"
Loading

0 comments on commit 4929db7

Please sign in to comment.