Skip to content

Commit

Permalink
[zellij] ml修正
Browse files Browse the repository at this point in the history
  • Loading branch information
nomutin committed Jul 28, 2024
1 parent 9e220dc commit 8abfa2a
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 63 deletions.
1 change: 0 additions & 1 deletion scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@ if [ "$(uname)" = "Darwin" ]; then

elif [ "$(uname)" = "Linux" ]; then
echo 'source "$HOME/.dotfiles/config/.bashrc.local"' >>~/.bashrc
echo 'source "$HOME/.rye/env"' >>~/.bashrc
source ~/.bashrc
fi
1 change: 1 addition & 0 deletions xdg_config/mise/config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[tools]
jq = "latest"
lazygit = "latest"
lua-language-server = "latest"
neovim = "nightly"
node = "20"
ripgrep = "latest"
Expand Down
111 changes: 52 additions & 59 deletions xdg_config/nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,10 @@
-- ====== 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"
vim.opt.completeopt = { "menuone", "noselect" }
vim.opt.completeopt = { "menu", "menuone", "noselect", "fuzzy", "popup" }
vim.opt.ignorecase = true
vim.opt.pumheight = 10
vim.opt.showtabline = 2
Expand All @@ -33,9 +23,18 @@ vim.opt.sidescrolloff = 8
vim.opt.laststatus = 3
vim.opt.list = true

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.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>]])
vim.keymap.set("t", "fd", [[<C-\><C-n>]], { desc = "Return to normal mode" })
vim.keymap.set("n", "<leader>n", "<cmd>Lexplore<cr>", { desc = "Open file explorer" })

-- ====== PLUGIN ======
Expand All @@ -45,57 +44,51 @@ if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
end
vim.opt.rtp:prepend(lazypath)
local servers = { "bashls", "biome", "jsonls", "lua_ls", "pyright", "ruff", "rust_analyzer", "yamlls" }

require("lazy").setup({
{ "github/copilot.vim", event = "BufRead" },
{
"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" },
defaults = { lazy = true },
rocks = { enabled = false },
spec = {
{ "github/copilot.vim", event = "BufRead" },
{
"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 = {} },
{
"williamboman/mason.nvim",
event = "BufRead",
dependencies = {
"williamboman/mason-lspconfig.nvim",
"neovim/nvim-lspconfig",
"hrsh7th/nvim-cmp",
"hrsh7th/cmp-nvim-lsp",
{ "lewis6991/gitsigns.nvim", event = "BufRead", opts = {} },
{ "nvim-lualine/lualine.nvim", event = "BufRead", opts = {} },
{
"nvim-lspconfig",
event = "BufRead",
dependencies = { "hrsh7th/nvim-cmp", "hrsh7th/cmp-nvim-lsp" },
config = function()
for _, server in ipairs(servers) do
local capabilities = require("cmp_nvim_lsp").default_capabilities()
require("lspconfig")[server].setup({ capabilities = capabilities })
end
local cmp = require("cmp")
cmp.setup({
mapping = cmp.mapping.preset.insert({}),
sources = cmp.config.sources({ { name = "nvim_lsp" } }),
})
end,
},
config = function()
require("mason").setup()
require("mason-lspconfig").setup()
require("mason-lspconfig").setup_handlers({
function(server_name)
require("lspconfig")[server_name].setup({
capabilities = require("cmp_nvim_lsp").default_capabilities(),
})
end,
})
local cmp = require("cmp")
cmp.setup({
mapping = cmp.mapping.preset.insert({}),
sources = cmp.config.sources({ { name = "nvim_lsp" } }),
})
end,
},
{
"nvim-treesitter/nvim-treesitter",
event = "BufRead",
main = "nvim-treesitter.configs",
opts = { highlight = { enable = true }, indent = { enable = true } },
},
{
"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" } },
{
"nvim-treesitter/nvim-treesitter",
event = "BufRead",
main = "nvim-treesitter.configs",
opts = { highlight = { enable = true }, indent = { enable = true } },
},
{
"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 },
})
6 changes: 3 additions & 3 deletions xdg_config/zellij/layouts/ml.kdl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout {

tab name="$HOME" cwd="$HOME" hide_floating_panes=true {
floating_panes {
pane x="6%" y="3%" width="88%" height="88%"
pane x="6%" y="3%" width="88%" height="88%" cwd="$HOME"
}

pane
Expand All @@ -16,8 +16,8 @@ layout {
floating_panes {
pane x="6%" y="3%" width="88%" height="88%" command="lazygit"
}
pane size="65%" split_direction="vertical" {
pane name="EDITOR" command="bash" {
pane split_direction="vertical" {
pane size="65%" name="EDITOR" command="bash" {
args "-c" "bash --rcfile <(cat ~/.bashrc; echo 'source .venv/bin/activate';)"
}
pane split_direction="horizontal" {
Expand Down

0 comments on commit 8abfa2a

Please sign in to comment.