Merge branch 'nixos' of gitlab.com:elitherl/dotfiles into nixos

This commit is contained in:
Evie Litherland-Smith 2023-04-22 09:10:23 +01:00
commit ede87d1ccb
20 changed files with 114 additions and 29 deletions

View file

@ -13,7 +13,7 @@ if not vim.loop.fs_stat(lazypath) then
} }
end end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
require("lazy").setup("plugins", require "config.lazy") require("lazy").setup(require "config.lazy")
-- Set vim options -- Set vim options
require "config" require "config"

View file

@ -0,0 +1,6 @@
return {
auto_hide = false,
hide = { extensions = true },
modified = { button = "" },
pinned = { button = "", filename = true, separator = { right = "" } },
}

View file

@ -3,6 +3,7 @@ return {
term_colors = true, term_colors = true,
transparent_background = false, transparent_background = false,
integrations = { integrations = {
barbar = true,
barbecue = { barbecue = {
dim_dirname = true, dim_dirname = true,
}, },

View file

@ -14,20 +14,28 @@ return {
action = "Telescope find_files", action = "Telescope find_files",
key = "f", key = "f",
}, },
{
icon = "",
icon_hl = "@variable",
desc = "Projects",
group = "Files",
action = "Telescope projects",
key = "p",
},
{ {
icon = "", icon = "",
icon_hl = "@variable", icon_hl = "@variable",
desc = "Terminal", desc = "Terminal",
group = "Files", group = "Files",
action = "ToggleTerm", action = "ToggleTerm",
key = "|", key = "t",
}, },
{ {
icon = "", icon = "",
desc = "Neotree", desc = "Neotree",
group = "Files", group = "Files",
action = "Neotree float reveal reveal_force_cwd", action = "Neotree float reveal reveal_force_cwd",
key = "/", key = "n",
}, },
{ {
icon = "", icon = "",
@ -45,14 +53,6 @@ return {
action = "Neogit commit", action = "Neogit commit",
key = "c", key = "c",
}, },
{
icon = "",
icon_hl = "@variable",
desc = "Git pull",
group = "Label",
action = "Neogit pull",
key = "p",
},
}, },
}, },
} }

View file

@ -1,5 +1,6 @@
-- Opt -- Opt
vim.opt.laststatus = 3 vim.opt.laststatus = 3
vim.opt.showtabline = 2
vim.opt.shiftwidth = 4 vim.opt.shiftwidth = 4
vim.opt.expandtab = true vim.opt.expandtab = true
vim.opt.number = true vim.opt.number = true

View file

@ -8,8 +8,7 @@ vim.keymap.set("n", "<leader>gg", "<cmd>Neogit kind=split<CR>")
vim.keymap.set("n", "<leader>cc", "<cmd>Neogit commit<CR>") vim.keymap.set("n", "<leader>cc", "<cmd>Neogit commit<CR>")
vim.keymap.set("n", "<leader>gp", "<cmd>Neogit kind=split pull<CR>") vim.keymap.set("n", "<leader>gp", "<cmd>Neogit kind=split pull<CR>")
vim.keymap.set("n", "<leader>gP", "<cmd>Neogit kind=split push<CR>") vim.keymap.set("n", "<leader>gP", "<cmd>Neogit kind=split push<CR>")
vim.keymap.set("n", "<leader>|", "<cmd>ToggleTerm<CR>") vim.keymap.set("n", "<leader>t", "<cmd>ToggleTerm<CR>")
vim.keymap.set("n", "<leader>tt", "<cmd>ToggleTerm direction=float<CR>")
vim.keymap.set({ "n", "t" }, "<A-h>", "<CMD>NavigatorLeft<CR>") vim.keymap.set({ "n", "t" }, "<A-h>", "<CMD>NavigatorLeft<CR>")
vim.keymap.set({ "n", "t" }, "<A-l>", "<CMD>NavigatorRight<CR>") vim.keymap.set({ "n", "t" }, "<A-l>", "<CMD>NavigatorRight<CR>")
vim.keymap.set({ "n", "t" }, "<A-k>", "<CMD>NavigatorUp<CR>") vim.keymap.set({ "n", "t" }, "<A-k>", "<CMD>NavigatorUp<CR>")
@ -28,7 +27,7 @@ vim.keymap.set("n", "<leader>fz", "<cmd>Telescope current_buffer_fuzzy_find<cr>"
vim.keymap.set("n", "<leader>fp", "<cmd>Telescope projects<cr>") vim.keymap.set("n", "<leader>fp", "<cmd>Telescope projects<cr>")
-- Neotree -- Neotree
vim.keymap.set("n", "/", "<cmd>Neotree float reveal reveal_force_cwd<cr>") vim.keymap.set("n", "<leader>nn", "<cmd>Neotree float reveal reveal_force_cwd<cr>")
vim.keymap.set("n", "<leader>nb", "<cmd>Neotree toggle show buffers right<cr>") vim.keymap.set("n", "<leader>nb", "<cmd>Neotree toggle show buffers right<cr>")
vim.keymap.set("n", "<leader>ns", "<cmd>Neotree float git_status<cr>") vim.keymap.set("n", "<leader>ns", "<cmd>Neotree float git_status<cr>")
@ -50,3 +49,49 @@ vim.keymap.set("n", "<leader>tn", "<cmd>TestNearest<cr>")
vim.keymap.set("n", "<leader>tl", "<cmd>TestLast<cr>") vim.keymap.set("n", "<leader>tl", "<cmd>TestLast<cr>")
vim.keymap.set("n", "<leader>tv", "<cmd>TestVisit<cr>") vim.keymap.set("n", "<leader>tv", "<cmd>TestVisit<cr>")
vim.keymap.set("n", "<leader>ti", "<cmd>TestInfo<cr>") vim.keymap.set("n", "<leader>ti", "<cmd>TestInfo<cr>")
-- barbar
-- local map = vim.api.nvim_set_keymap
local map = vim.keymap.set
local opts = { noremap = true, silent = true }
-- Move to previous/next
map('n', '<A-,>', '<Cmd>BufferPrevious<CR>', opts)
map('n', '<A-.>', '<Cmd>BufferNext<CR>', opts)
-- Re-order to previous/next
map('n', '<A-<>', '<Cmd>BufferMovePrevious<CR>', opts)
map('n', '<A->>', '<Cmd>BufferMoveNext<CR>', opts)
-- Goto buffer in position...
map('n', '<A-1>', '<Cmd>BufferGoto 1<CR>', opts)
map('n', '<A-2>', '<Cmd>BufferGoto 2<CR>', opts)
map('n', '<A-3>', '<Cmd>BufferGoto 3<CR>', opts)
map('n', '<A-4>', '<Cmd>BufferGoto 4<CR>', opts)
map('n', '<A-5>', '<Cmd>BufferGoto 5<CR>', opts)
map('n', '<A-6>', '<Cmd>BufferGoto 6<CR>', opts)
map('n', '<A-7>', '<Cmd>BufferGoto 7<CR>', opts)
map('n', '<A-8>', '<Cmd>BufferGoto 8<CR>', opts)
map('n', '<A-9>', '<Cmd>BufferGoto 9<CR>', opts)
map('n', '<A-0>', '<Cmd>BufferLast<CR>', opts)
-- Pin/unpin buffer
map('n', '<A-p>', '<Cmd>BufferPin<CR>', opts)
-- Close buffer
map('n', '<A-c>', '<Cmd>BufferClose<CR>', opts)
-- Wipeout buffer
-- :BufferWipeout
-- Close commands
-- :BufferCloseAllButCurrent
-- :BufferCloseAllButPinned
-- :BufferCloseAllButCurrentOrPinned
-- :BufferCloseBuffersLeft
-- :BufferCloseBuffersRight
-- Magic buffer-picking mode
map('n', '<C-p>', '<Cmd>BufferPick<CR>', opts)
-- Sort automatically by...
map('n', '<Space>bb', '<Cmd>BufferOrderByBufferNumber<CR>', opts)
map('n', '<Space>bd', '<Cmd>BufferOrderByDirectory<CR>', opts)
map('n', '<Space>bl', '<Cmd>BufferOrderByLanguage<CR>', opts)
map('n', '<Space>bw', '<Cmd>BufferOrderByWindowNumber<CR>', opts)
-- Other:
-- :BarbarEnable - enables barbar (enabled by default)
-- :BarbarDisable - very bad command, should never be used

View file

@ -1,4 +1,5 @@
return { return {
spec = "plugins",
dev = { dev = {
path = "~/Projects/lua/nvim", path = "~/Projects/lua/nvim",
}, },
@ -32,4 +33,18 @@ return {
enabled = true, enabled = true,
frequency = 3600, frequency = 3600,
}, },
performance = {
rtp = {
disabled_plugins = {
"gzip",
"matchit",
"matchparen",
"netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
} }

View file

@ -12,6 +12,7 @@ return {
hide_dotfiles = false, hide_dotfiles = false,
}, },
group_empty_dirs = true, group_empty_dirs = true,
hijack_netrw_behavior = "open_current",
}, },
buffers = { buffers = {
bind_to_cwd = true, bind_to_cwd = true,

View file

@ -0,0 +1,8 @@
return {
"romgrk/barbar.nvim",
dependencies = "nvim-tree/nvim-web-devicons",
event = { "BufReadPre", "BufNewFile" },
init = function() vim.g.barbar_auto_setup = false end,
-- opts = require "config.barbar",
version = "^1.0.0", -- optional: only update when a new 1.x version is released
}

View file

@ -0,0 +1,9 @@
return {
"https://github.com/direnv/direnv.vim.git",
name = "direnv.vim",
lazy = false,
config = function()
vim.g.direnv_auto = 1
vim.g.direnv_silent_load = 1
end,
}

View file

@ -6,9 +6,10 @@ return {
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim", "MunifTanjim/nui.nvim",
}, },
cmd = "Neotree",
config = function() config = function()
vim.cmd [[ let g:neo_tree_remove_legacy_commands = 1 ]] vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.g.neo_tree_remove_legacy_commands = 1
require("neo-tree").setup(require "config.neotree") require("neo-tree").setup(require "config.neotree")
end, end,
} }

View file

@ -1,5 +1,5 @@
return { return {
"ahmedkhalf/project.nvim", "ahmedkhalf/project.nvim",
event = { "BufReadPre", "BufNewFile" }, event = { "VimEnter", "BufReadPre", "BufNewFile" },
config = function() require("project_nvim").setup(require "config.project") end, config = function() require("project_nvim").setup(require "config.project") end,
} }

View file

@ -1,7 +1,4 @@
{ ... }: { { ... }: {
imports = [ imports = [ ./common/work.nix ];
./common/work.nix
./desktop/gtk.nix
];
home.stateVersion = "22.11"; home.stateVersion = "22.11";
} }

View file

@ -1,7 +1,4 @@
{ ... }: { { ... }: {
imports = [ imports = [ ./common/work.nix ];
./common/work.nix
./desktop/gtk.nix
];
home.stateVersion = "22.11"; home.stateVersion = "22.11";
} }

View file

@ -2,6 +2,7 @@
imports = [ imports = [
./common/personal.nix ./common/personal.nix
./desktop/gtk.nix ./desktop/gtk.nix
./desktop/wayland.nix
./env ./env
./tui ./tui
./gui/firefox ./gui/firefox

View file

@ -2,6 +2,7 @@
imports = [ imports = [
./common/personal.nix ./common/personal.nix
./desktop/gtk.nix ./desktop/gtk.nix
./desktop/wayland.nix
./env ./env
./tui ./tui
./gui/firefox.nix ./gui/firefox.nix

View file

@ -1,6 +1,8 @@
{ ... }: { ... }:
{ {
imports = [ imports = [
../desktop/gtk.nix
../desktop/wayland.nix
../env ../env
../tui ../tui
../gui/chromium-wayland.nix ../gui/chromium-wayland.nix

4
home/desktop/wayland.nix Normal file
View file

@ -0,0 +1,4 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [ wl-clipboard ];
}

View file

@ -21,6 +21,3 @@ Host freia???
Host heimdall* jdc* freia* batch Host heimdall* jdc* freia* batch
User elitherl User elitherl
ForwardX11 yes
ForwardX11Timeout 0
Compression yes

View file

@ -4,5 +4,4 @@ Host legion xenia xenia.me.uk
User xenia User xenia
HostName xenia.me.uk HostName xenia.me.uk
Port 30 Port 30
ForwardX11 no
ForwardAgent yes ForwardAgent yes