From cb35955d16f7c39ea1ccc9258ffdffa94e56a9c7 Mon Sep 17 00:00:00 2001 From: Kj Tsanaktsidis Date: Fri, 12 Sep 2025 20:34:02 +1000 Subject: lazyvim --- kj-laptop01/home.nix | 49 ++---------------------------------------- kj-laptop01/lazyvim-config.lua | 49 ++++++++++++++++++++++++++++++++++++++++++ kj-laptop01/zsh-config.zsh | 45 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+), 47 deletions(-) create mode 100644 kj-laptop01/lazyvim-config.lua create mode 100644 kj-laptop01/zsh-config.zsh diff --git a/kj-laptop01/home.nix b/kj-laptop01/home.nix index b450887..7d18022 100644 --- a/kj-laptop01/home.nix +++ b/kj-laptop01/home.nix @@ -50,6 +50,7 @@ ]; extraLuaConfig = '' require("lazyvim").setup() + ${builtins.readFile ./lazyvim-config.lua} ''; }; @@ -84,53 +85,7 @@ ignoreDups = false; }; - initContent = '' - # Initialize completion system - autoload -Uz compinit - compinit - - # Initialize prompt system - autoload -Uz promptinit - promptinit - - # Set options - setopt extendedglob nomatch notify - - # Define gentoo prompt theme - prompt_gentoo_help () { - cat <<'EOF' - This prompt is color-scheme-able. You can invoke it thus: - - prompt gentoo [ [ []]] - - EOF - } - - prompt_gentoo_setup () { - local prompt_gentoo_prompt=''${1:-'blue'} - local prompt_gentoo_user=''${2:-'green'} - local prompt_gentoo_root=''${3:-'red'} - - if [ "$USER" = 'root' ] - then - local base_prompt="%B%F{$prompt_gentoo_root}%m%k " - else - local base_prompt="%B%F{$prompt_gentoo_user}%n@%m%k " - fi - local post_prompt="%b%f%k" - - local path_prompt="%B%F{$prompt_gentoo_prompt}%1~" - typeset -g PS1="$base_prompt$path_prompt %# $post_prompt" - typeset -g PS2="$base_prompt$path_prompt %_> $post_prompt" - typeset -g PS3="$base_prompt$path_prompt ?# $post_prompt" - } - - # Register the prompt with promptinit - prompt_themes+=( gentoo ) - - # Use the gentoo prompt - prompt gentoo - ''; + initContent = builtins.readFile ./zsh-config.zsh; }; # FZF with standard keybindings diff --git a/kj-laptop01/lazyvim-config.lua b/kj-laptop01/lazyvim-config.lua new file mode 100644 index 0000000..038ed1b --- /dev/null +++ b/kj-laptop01/lazyvim-config.lua @@ -0,0 +1,49 @@ +-- Store a lot of history +vim.opt.history = 10000 +-- Enable mouse support +vim.opt.mouse = "a" +-- Line numbers +vim.opt.number = true +-- Vim janks about a lot as the LSP floats in or out if the sign column width +-- is not fixed ahead of time. +vim.opt.signcolumn = "yes:1" +-- don't take up the whole screen with popups +vim.opt.pumheight = 15 +-- lazy.nvim does relative line numbers +vim.wo.relativenumber = false +-- .nvimrc files +vim.opt.exrc = true +-- disable autoformat by default +vim.g.autoformat = false +vim.g.root_spec = { "cwd" } + +--[[ +local cmp = require("cmp") +local enabled_except_in_comments = function() + if vim.api.nvim_get_mode().mode == "c" then + return true + else + local context = require("cmp.config.context") + return not context.in_treesitter_capture("comment") and not context.in_syntax_group("Comment") + end +end +cmp.setup.filetype("markdown", { + enabled = false, +}) + +for _, ft in ipairs({ "c", "cpp", "ruby" }) do + cmp.setup.filetype(ft, { + enabled = enabled_except_in_comments, + }) +end +]]-- + +vim.api.nvim_create_user_command("DiagHide", function(args) + vim.diagnostic.enable(false) +end, {}) +vim.api.nvim_create_user_command("DiagShow", function(args) + vim.diagnostic.enable(true) +end, {}) +vim.api.nvim_create_user_command("FindRefs", function(args) + require("telescope.builtin").lsp_references() +end, {}) diff --git a/kj-laptop01/zsh-config.zsh b/kj-laptop01/zsh-config.zsh new file mode 100644 index 0000000..8ef8747 --- /dev/null +++ b/kj-laptop01/zsh-config.zsh @@ -0,0 +1,45 @@ +# Initialize completion system +autoload -Uz compinit +compinit + +# Initialize prompt system +autoload -Uz promptinit +promptinit + +# Set options +setopt extendedglob nomatch notify + +# Define gentoo prompt theme +prompt_gentoo_help () { + cat <<'EOF' +This prompt is color-scheme-able. You can invoke it thus: + + prompt gentoo [ [ []]] + +EOF +} + +prompt_gentoo_setup () { + local prompt_gentoo_prompt=${1:-'blue'} + local prompt_gentoo_user=${2:-'green'} + local prompt_gentoo_root=${3:-'red'} + + if [ "$USER" = 'root' ] + then + local base_prompt="%B%F{$prompt_gentoo_root}%m%k " + else + local base_prompt="%B%F{$prompt_gentoo_user}%n@%m%k " + fi + local post_prompt="%b%f%k" + + local path_prompt="%B%F{$prompt_gentoo_prompt}%1~" + typeset -g PS1="$base_prompt$path_prompt %# $post_prompt" + typeset -g PS2="$base_prompt$path_prompt %_> $post_prompt" + typeset -g PS3="$base_prompt$path_prompt ?# $post_prompt" +} + +# Register the prompt with promptinit +prompt_themes+=( gentoo ) + +# Use the gentoo prompt +prompt gentoo -- cgit v1.2.3