commit 97d4286a69b7680fdae953b0445ba84fa87ac400
parent de4e0cdee5b3aec64840b2912ce50542a36ec94c
Author: Benjamin Paul <bpaul848@gmail.com>
Date: Tue, 4 May 2021 08:02:25 +1000
half switched to modules
Diffstat:
19 files changed, 790 insertions(+), 93 deletions(-)
diff --git a/home/alacritty.nix b/home/alacritty.nix
@@ -1,25 +0,0 @@
-{
- enable = true;
-
- settings = {
- font = {
- size = 9;
- normal = {
- family = "Hack";
- style = "Regular";
- };
- bold = {
- family = "Hack";
- style = "Bold";
- };
- italic = {
- family = "Hack";
- style = "Italic";
- };
- bold_italic = {
- family = "Hack";
- style = "Bold Italic";
- };
- };
- };
-}
diff --git a/home/home.nix b/home/home.nix
@@ -3,6 +3,19 @@
{
home.stateVersion = "20.09";
+ imports = [
+ modules/alacritty.nix
+ modules/starship.nix
+ modules/zsh.nix
+ ];
+
+ alacritty.enable = true;
+ starship.enable = true;
+ zsh = {
+ enable = true;
+ editor = "nvim";
+ };
+
home.packages = [
# packages
pkgs.ccls
@@ -12,13 +25,7 @@
];
programs = {
- alacritty = import ./alacritty.nix;
-
neovim = import ./neovim { inherit pkgs; };
-
- zsh = import ./zsh.nix { inherit pkgs; };
-
- starship = import ./starship.nix;
};
services.polybar = import ./polybar.nix;
diff --git a/home/modules/alacritty.nix b/home/modules/alacritty.nix
@@ -0,0 +1,37 @@
+{ config, pkgs, lib, ... }:
+
+with lib;
+
+{
+ options.alacritty = {
+ enable = mkEnableOption "Alacritty";
+ };
+
+ config = mkIf config.alacritty.enable {
+ programs.alacritty = {
+ enable = true;
+
+ settings = {
+ font = {
+ size = 9;
+ normal = {
+ family = "Hack";
+ style = "Regular";
+ };
+ bold = {
+ family = "Hack";
+ style = "Bold";
+ };
+ italic = {
+ family = "Hack";
+ style = "Italic";
+ };
+ bold_italic = {
+ family = "Hack";
+ style = "Bold Italic";
+ };
+ };
+ };
+ };
+ };
+}
diff --git a/home/modules/neovim/c.lua b/home/modules/neovim/c.lua
@@ -0,0 +1,17 @@
+-- c ftplugin
+
+-- Use tabs instead of spaces for c files
+vim.bo.tabstop = 4
+vim.bo.softtabstop = 0
+vim.bo.shiftwidth = 4
+vim.bo.expandtab = false
+vim.bo.autoindent = true
+vim.o.tabstop = 4
+vim.o.softtabstop = 0
+vim.o.shiftwidth = 4
+vim.o.expandtab = false
+vim.o.autoindent = true
+vim.o.smarttab = true
+
+-- Make the width of a line 79 characters (if you have more it is ugly!)
+vim.bo.textwidth = 79
diff --git a/home/modules/neovim/cpp.lua b/home/modules/neovim/cpp.lua
@@ -0,0 +1,14 @@
+-- cpp ftplugin
+
+-- Use spaces for cpp files
+vim.bo.tabstop = 4
+vim.bo.softtabstop = 4
+vim.bo.shiftwidth = 4
+vim.bo.expandtab = true
+vim.bo.autoindent = true
+vim.o.tabstop = 4
+vim.o.softtabstop = 4
+vim.o.shiftwidth = 4
+vim.o.expandtab = true
+vim.o.autoindent = true
+vim.o.smarttab = true
diff --git a/home/modules/neovim/default.nix b/home/modules/neovim/default.nix
@@ -0,0 +1,35 @@
+{ pkgs, ... }:
+
+{
+ enable = true;
+ package = pkgs.neovim;
+ extraConfig = ''
+ lua << EOF
+ ${builtins.readFile ./init.lua}
+
+ function c()
+ ${builtins.readFile ./c.lua}
+ end
+ function cpp()
+ ${builtins.readFile ./cpp.lua}
+ end
+ function lua()
+ ${builtins.readFile ./lua.lua}
+ end
+ function tex()
+ ${builtins.readFile ./tex.lua}
+ end
+ EOF
+ au BufEnter *.c lua c()
+ au BufEnter *.cpp lua cpp()
+ au BufEnter *.lua lua lua()
+ au BufEnter *.tex lua tex()
+ '';
+ plugins = with pkgs.vimPlugins; [
+ { plugin = vim-nix; }
+ { plugin = idris2-vim; }
+ { plugin = gruvbox; config = "colorscheme gruvbox"; }
+ { plugin = nvim-lspconfig; }
+ { plugin = nvim-treesitter; config = "lua require'nvim-treesitter.configs'.setup{highlight={enable=true}}"; }
+ ];
+}
diff --git a/home/modules/neovim/init.lua b/home/modules/neovim/init.lua
@@ -0,0 +1,70 @@
+-- vimrc but lua
+
+-- Set leader to space
+vim.g.mapleader = ' '
+
+-- Line numbers
+-- See :h number_relativenumber
+vim.wo.number = true
+vim.wo.relativenumber = true
+
+-- Tab configuration
+-- See :h tabstop for tab configuration stuff
+vim.bo.tabstop = 4
+vim.bo.softtabstop = 4
+vim.bo.shiftwidth = 4
+vim.bo.expandtab = true
+vim.bo.autoindent = true
+vim.o.tabstop = 4
+vim.o.softtabstop = 4
+vim.o.shiftwidth = 4
+vim.o.expandtab = true
+vim.o.autoindent = true
+vim.o.smarttab = true
+
+-- Use Australian spelling
+vim.bo.spelllang = 'en_au'
+
+-- Ruler shows the line and column number at the bottom right
+vim.o.ruler = true
+
+-- Always show the tab bar for consistency
+vim.o.showtabline = 2
+
+-- Make underscore separated words separate words
+--vim.bo.iskeyword = vim.bo.iskeyword:gsub(",_","")
+--vim.o.iskeyword = vim.o.iskeyword:gsub(",_","")
+
+-- Dont wrap long lines
+vim.wo.wrap = false
+
+-- Dont highlight searches
+vim.o.hlsearch = false
+
+-- Make CTRL-L clear echo and search
+vim.api.nvim_set_keymap('n', '<C-L>', ':noh<CR>:mode<CR>',
+ { noremap = true, silent = true })
+
+-- Make leader+a insert one from the end of the line because semicolon
+vim.api.nvim_set_keymap('n', '<leader>a', '$i',
+ { noremap = true, silent = true })
+-- Make leader+x delete char at the end of the line
+vim.api.nvim_set_keymap('n', '<leader>x', '$x',
+ { noremap = true, silent = true })
+-- Make leader+f fix the spelling of the current word
+vim.api.nvim_set_keymap('n', '<leader>f', '1z=',
+ { noremap = true, silent = true })
+
+-- Make Shift-Delete do nothing (my keyboard is weird so I press it a lot)
+vim.api.nvim_set_keymap('i', '<S-Del>', '', { noremap = true, silent = true })
+
+-- Colour column shows the text width of a file
+vim.wo.colorcolumn = vim.wo.colorcolumn .. '+' .. 1
+for i = 2,255 do vim.wo.colorcolumn = vim.wo.colorcolumn .. ',+' .. i end
+
+-- LSP
+
+require('lspconfig').ccls.setup{}
+
+-- Always have the sign column so that code doesnt move around on error
+vim.wo.signcolumn = "yes"
diff --git a/home/modules/neovim/lua.lua b/home/modules/neovim/lua.lua
@@ -0,0 +1,17 @@
+-- lua ftplugin
+
+-- Use spaces for lua files
+vim.bo.tabstop = 4
+vim.bo.softtabstop = 4
+vim.bo.shiftwidth = 4
+vim.bo.expandtab = true
+vim.bo.autoindent = true
+vim.o.tabstop = 4
+vim.o.softtabstop = 4
+vim.o.shiftwidth = 4
+vim.o.expandtab = true
+vim.o.autoindent = true
+vim.o.smarttab = true
+
+-- Make the width of a line 79 characters (if you have more it is ugly!)
+vim.bo.textwidth = 79
diff --git a/home/modules/neovim/settings.vim b/home/modules/neovim/settings.vim
@@ -0,0 +1,25 @@
+" I might comment this later
+
+let mapleader = ' '
+let maplocalleader = '\'
+
+set number relativenumber
+
+set tabstop=4 softtabstop=4 shiftwidth=4 expandtab autoindent smarttab
+
+set ruler
+
+set showtabline=2
+
+set nowrap
+
+set nohlsearch
+
+set signcolumn="yes"
+
+let &colorcolumn="+".join(range(0,254),",+")
+
+nnoremap <C-L> :noh<CR>:mode<CR>
+nnoremap <leader>a $i
+nnoremap <leader>x $x
+inoremap <S-Del> <Nop>
diff --git a/home/modules/neovim/tex.lua b/home/modules/neovim/tex.lua
@@ -0,0 +1,16 @@
+-- latex ftplugin
+
+-- Set the text width to 79 characters
+vim.bo.textwidth = 79
+
+-- Enable spell checking
+vim.wo.spell = true
+
+-- Bind <leader>+c to ci{ the last {} on the current line
+-- e.g. <leader>+c would make \command{ahesifuhisg} \command{} with insert
+vim.api.nvim_set_keymap('n', '<leader>c', '$bci{',
+ { noremap = true, silent = true })
+
+-- Bind <leader>+d to duplicate the current line down
+vim.api.nvim_set_keymap('n', '<leader>d', 'yyp',
+ { noremap = true, silent = true })
diff --git a/home/modules/polybar.conf b/home/modules/polybar.conf
@@ -0,0 +1,428 @@
+;==========================================================
+;
+;
+; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗
+; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
+; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝
+; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗
+; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║
+; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
+;
+;
+; To learn more about how to configure Polybar
+; go to https://github.com/polybar/polybar
+;
+; The README contains a lot of information
+;
+;==========================================================
+
+[colors]
+background = ${xrdb:background}
+;background = #222
+background-alt = #444
+foreground = ${xrdb:foreground}
+;foreground = #dfdfdf
+foreground-alt = #555
+primary = #ffb52a
+secondary = #e60053
+alert = #bd2c40
+
+; Bars
+[bar/base]
+font-0 = HackNerdFont:size=10:antialias=true;3
+
+height = 25
+radius = 15
+
+background = ${colors.background}
+
+offset-y = 5
+
+wm-restack = bspwm
+
+[bar/wm_left]
+inherit = bar/base
+
+monitor = ${env:MONITOR:HDMI-A-0}
+
+offset-x = 5
+
+width = 22%
+
+modules-center = bspwm
+
+[bar/wm_right]
+inherit = bar/base
+
+monitor = ${env:MONITOR:DisplayPort-2}
+
+offset-x = 5
+
+width = 22%
+
+modules-center = bspwm
+
+[bar/time]
+inherit = bar/base
+
+monitor = ${env:MONITOR:DisplayPort-2}
+
+offset-x = 91.5%
+
+width = 8%
+
+modules-center = date powermenu
+
+tray-position = right
+tray-padding = 2
+
+; Modules
+
+[module/xwindow]
+type = internal/xwindow
+label = %title:0:30:...%
+
+[module/xkeyboard]
+type = internal/xkeyboard
+blacklist-0 = num lock
+
+format-prefix = " "
+format-prefix-foreground = ${colors.foreground-alt}
+format-prefix-underline = ${colors.secondary}
+
+label-layout = %layout%
+label-layout-underline = ${colors.secondary}
+
+label-indicator-padding = 2
+label-indicator-margin = 1
+label-indicator-background = ${colors.secondary}
+label-indicator-underline = ${colors.secondary}
+
+[module/filesystem]
+type = internal/fs
+interval = 25
+
+mount-0 = /
+
+label-mounted = %{F#0a81f5}%mountpoint%%{F-}: %percentage_used%%
+label-unmounted = %mountpoint% not mounted
+label-unmounted-foreground = ${colors.foreground-alt}
+
+[module/bspwm]
+type = internal/bspwm
+
+;label-focused = %index%
+label-focused =
+label-focused-background = ${colors.background-alt}
+label-focused-underline= ${colors.primary}
+label-focused-padding = 2
+
+;label-occupied = %index%
+label-occupied =
+label-occupied-padding = 2
+
+;label-urgent = %index%!
+label-urgent =
+label-urgent-background = ${colors.alert}
+label-urgent-padding = 2
+
+;label-empty = %index%
+label-empty =
+label-empty-foreground = ${colors.foreground-alt}
+label-empty-padding = 2
+
+; Separator in between workspaces
+; label-separator = |
+
+[module/i3]
+type = internal/i3
+format = <label-state> <label-mode>
+index-sort = true
+wrapping-scroll = false
+
+; Only show workspaces on the same output as the bar
+;pin-workspaces = true
+
+label-mode-padding = 2
+label-mode-foreground = #000
+label-mode-background = ${colors.primary}
+
+; focused = Active workspace on focused monitor
+label-focused = %index%
+label-focused-background = ${colors.background-alt}
+label-focused-underline= ${colors.primary}
+label-focused-padding = 2
+
+; unfocused = Inactive workspace on any monitor
+label-unfocused = %index%
+label-unfocused-padding = 2
+
+; visible = Active workspace on unfocused monitor
+label-visible = %index%
+label-visible-background = ${self.label-focused-background}
+label-visible-underline = ${self.label-focused-underline}
+label-visible-padding = ${self.label-focused-padding}
+
+; urgent = Workspace with urgency hint set
+label-urgent = %index%
+label-urgent-background = ${colors.alert}
+label-urgent-padding = 2
+
+; Separator in between workspaces
+; label-separator = |
+
+
+[module/mpd]
+type = internal/mpd
+format-online = <label-song> <icon-prev> <icon-stop> <toggle> <icon-next>
+
+icon-prev =
+icon-stop =
+icon-play =
+icon-pause =
+icon-next =
+
+label-song-maxlen = 25
+label-song-ellipsis = true
+
+[module/xbacklight]
+type = internal/xbacklight
+
+format = <label> <bar>
+label = BL
+
+bar-width = 10
+bar-indicator = |
+bar-indicator-foreground = #fff
+bar-indicator-font = 2
+bar-fill = ─
+bar-fill-font = 2
+bar-fill-foreground = #9f78e1
+bar-empty = ─
+bar-empty-font = 2
+bar-empty-foreground = ${colors.foreground-alt}
+
+[module/backlight-acpi]
+inherit = module/xbacklight
+type = internal/backlight
+card = intel_backlight
+
+[module/cpu]
+type = internal/cpu
+interval = 2
+format-prefix = " "
+format-prefix-foreground = ${colors.foreground-alt}
+format-underline = #f90000
+label = %percentage:2%%
+
+[module/memory]
+type = internal/memory
+interval = 2
+format-prefix = " "
+format-prefix-foreground = ${colors.foreground-alt}
+format-underline = #4bffdc
+label = %percentage_used%%
+
+[module/wlan]
+type = internal/network
+interface = net1
+interval = 3.0
+
+format-connected = <ramp-signal> <label-connected>
+format-connected-underline = #9f78e1
+label-connected = %essid%
+
+format-disconnected =
+;format-disconnected = <label-disconnected>
+;format-disconnected-underline = ${self.format-connected-underline}
+;label-disconnected = %ifname% disconnected
+;label-disconnected-foreground = ${colors.foreground-alt}
+
+ramp-signal-0 =
+ramp-signal-1 =
+ramp-signal-2 =
+ramp-signal-3 =
+ramp-signal-4 =
+ramp-signal-foreground = ${colors.foreground-alt}
+
+[module/eth]
+type = internal/network
+interface = enp4s0
+interval = 3.0
+
+format-connected-underline = #55aa55
+format-connected-prefix = " "
+format-connected-prefix-foreground = ${colors.foreground-alt}
+label-connected = %local_ip%
+
+format-disconnected =
+;format-disconnected = <label-disconnected>
+;format-disconnected-underline = ${self.format-connected-underline}
+;label-disconnected = %ifname% disconnected
+;label-disconnected-foreground = ${colors.foreground-alt}
+
+[module/date]
+type = internal/date
+interval = 5
+
+date =
+date-alt = " %Y-%m-%d"
+
+time = %H:%M
+time-alt = %H:%M:%S
+
+format-prefix =
+format-prefix-foreground = ${colors.foreground-alt}
+format-underline = #0a6cf5
+
+label = %date% %time%
+
+[module/pulseaudio]
+type = internal/pulseaudio
+
+format-volume = <label-volume> <bar-volume>
+label-volume = VOL %percentage%%
+label-volume-foreground = ${root.foreground}
+
+label-muted = 🔇 muted
+label-muted-foreground = #666
+
+bar-volume-width = 10
+bar-volume-foreground-0 = #55aa55
+bar-volume-foreground-1 = #55aa55
+bar-volume-foreground-2 = #55aa55
+bar-volume-foreground-3 = #55aa55
+bar-volume-foreground-4 = #55aa55
+bar-volume-foreground-5 = #f5a70a
+bar-volume-foreground-6 = #ff5555
+bar-volume-gradient = false
+bar-volume-indicator = |
+bar-volume-indicator-font = 2
+bar-volume-fill = ─
+bar-volume-fill-font = 2
+bar-volume-empty = ─
+bar-volume-empty-font = 2
+bar-volume-empty-foreground = ${colors.foreground-alt}
+
+[module/alsa]
+type = internal/alsa
+
+format-volume = <label-volume> <bar-volume>
+label-volume = VOL
+label-volume-foreground = ${root.foreground}
+
+format-muted-prefix = " "
+format-muted-foreground = ${colors.foreground-alt}
+label-muted = sound muted
+
+bar-volume-width = 10
+bar-volume-foreground-0 = #55aa55
+bar-volume-foreground-1 = #55aa55
+bar-volume-foreground-2 = #55aa55
+bar-volume-foreground-3 = #55aa55
+bar-volume-foreground-4 = #55aa55
+bar-volume-foreground-5 = #f5a70a
+bar-volume-foreground-6 = #ff5555
+bar-volume-gradient = false
+bar-volume-indicator = |
+bar-volume-indicator-font = 2
+bar-volume-fill = ─
+bar-volume-fill-font = 2
+bar-volume-empty = ─
+bar-volume-empty-font = 2
+bar-volume-empty-foreground = ${colors.foreground-alt}
+
+[module/battery]
+type = internal/battery
+battery = BAT0
+adapter = ADP1
+full-at = 98
+
+format-charging = <animation-charging> <label-charging>
+format-charging-underline = #ffb52a
+
+format-discharging = <animation-discharging> <label-discharging>
+format-discharging-underline = ${self.format-charging-underline}
+
+format-full-prefix = " "
+format-full-prefix-foreground = ${colors.foreground-alt}
+format-full-underline = ${self.format-charging-underline}
+
+ramp-capacity-0 =
+ramp-capacity-1 =
+ramp-capacity-2 =
+ramp-capacity-foreground = ${colors.foreground-alt}
+
+animation-charging-0 =
+animation-charging-1 =
+animation-charging-2 =
+animation-charging-foreground = ${colors.foreground-alt}
+animation-charging-framerate = 750
+
+animation-discharging-0 =
+animation-discharging-1 =
+animation-discharging-2 =
+animation-discharging-foreground = ${colors.foreground-alt}
+animation-discharging-framerate = 750
+
+[module/temperature]
+type = internal/temperature
+thermal-zone = 0
+warn-temperature = 60
+
+format = <ramp> <label>
+format-underline = #f50a4d
+format-warn = <ramp> <label-warn>
+format-warn-underline = ${self.format-underline}
+
+label = %temperature-c%
+label-warn = %temperature-c%
+label-warn-foreground = ${colors.secondary}
+
+ramp-0 =
+ramp-1 =
+ramp-2 =
+ramp-foreground = ${colors.foreground-alt}
+
+[module/powermenu]
+type = custom/menu
+
+expand-right = true
+
+format-spacing = 1
+
+label-open =
+label-open-foreground = ${colors.secondary}
+label-close = cancel
+label-close-foreground = ${colors.secondary}
+label-separator = |
+label-separator-foreground = ${colors.foreground-alt}
+
+menu-0-0 = reboot
+menu-0-0-exec = menu-open-1
+menu-0-1 = power off
+menu-0-1-exec = menu-open-2
+
+menu-1-0 = cancel
+menu-1-0-exec = menu-open-0
+menu-1-1 = reboot
+menu-1-1-exec = sudo reboot
+
+menu-2-0 = power off
+menu-2-0-exec = sudo poweroff
+menu-2-1 = cancel
+menu-2-1-exec = menu-open-0
+
+[settings]
+screenchange-reload = true
+;compositing-background = xor
+;compositing-background = screen
+;compositing-foreground = source
+;compositing-border = over
+;pseudo-transparency = false
+
+[global/wm]
+margin-top = 5
+margin-bottom = 5
+
+; vim:ft=dosini
diff --git a/home/modules/polybar.nix b/home/modules/polybar.nix
@@ -0,0 +1,7 @@
+{
+ enable = true;
+
+ script = builtins.readFile ./polybar.sh;
+
+ config = ./polybar.conf;
+}
diff --git a/home/modules/polybar.sh b/home/modules/polybar.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+# Terminate already running bar instences
+killall -q polybar
+
+# Wait until the processes have been shut down
+while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
+
+# Launch Polybar
+polybar -rq wm_left &
+polybar -rq wm_right &
+polybar -rq time &
diff --git a/home/modules/starship.nix b/home/modules/starship.nix
@@ -0,0 +1,19 @@
+{ config, pkgs, lib, ... }:
+
+with lib;
+
+{
+ options.starship = {
+ enable = mkEnableOption "Starship";
+ };
+
+ config = mkIf config.starship.enable {
+ programs.starship = {
+ enable = true;
+
+ settings = {
+ add_newline = false;
+ };
+ };
+ };
+}
diff --git a/home/modules/zsh.nix b/home/modules/zsh.nix
@@ -0,0 +1,68 @@
+{ config, pkgs, lib, ... }:
+
+with lib;
+
+let editor = "nvim";
+in
+{
+ options.zsh = {
+ enable = mkEnableOption "Zsh";
+
+ editor = mkOption {
+ type = types.str;
+ default = "nvim";
+ example = "nano";
+ description = "The default editor, which is what \$EDITOR will be set to";
+ };
+ };
+
+ config = mkIf config.zsh.enable {
+ programs.zsh = {
+ enable = true;
+
+ history = {
+ path = ".cache/zsh/history";
+ };
+
+ # bind keys properly for backword or switch to vi mode??
+
+ shellAliases = {
+ ls = "ls --color=auto";
+ l = "ls";
+ la = "ls -la";
+ grep = "grep --color=auto";
+ v = config.zsh.editor;
+ ga = "git add";
+ gc = "git commit";
+ gd = "git diff";
+ gp = "git push";
+ gs = "git status";
+ tmux = "tmux -2";
+ die = "shutdown now";
+ };
+
+ sessionVariables = {
+ EDITOR = config.zsh.editor;
+ NIX_PATH = "\$HOME/.nix-defexpr/channels\${NIX_PATH:+:}\$NIX_PATH";
+ TERMINAL = "alacritty";
+ };
+
+ # initExtra = ''
+ # . ~/.nix-profile/etc/profile.d/nix.sh
+ # '';
+
+ plugins = [
+ {
+ name = "zsh-nix-shell";
+ file = "nix-shell.plugin.zsh";
+ src = pkgs.fetchFromGitHub {
+ owner = "chisui";
+ repo = "zsh-nix-shell";
+ rev = "v0.1.0";
+ sha256 = "0snhch9hfy83d4amkyxx33izvkhbwmindy0zjjk28hih1a9l2jmx";
+ };
+ }
+ ];
+ };
+ };
+}
diff --git a/home/neovim/init.lua b/home/neovim/init.lua
@@ -59,8 +59,8 @@ vim.api.nvim_set_keymap('n', '<leader>f', '1z=',
vim.api.nvim_set_keymap('i', '<S-Del>', '', { noremap = true, silent = true })
-- Colour column shows the text width of a file
-vim.wo.colorcolumn = vim.wo.colorcolumn .. '+' .. 0
-for i = 1,254 do vim.wo.colorcolumn = vim.wo.colorcolumn .. ',+' .. i end
+vim.wo.colorcolumn = vim.wo.colorcolumn .. '+' .. 1
+for i = 2,255 do vim.wo.colorcolumn = vim.wo.colorcolumn .. ',+' .. i end
-- LSP
diff --git a/home/neovim/tex.lua b/home/neovim/tex.lua
@@ -1,6 +1,16 @@
-- latex ftplugin
+-- Set the text width to 79 characters
+vim.bo.textwidth = 79
+
+-- Enable spell checking
+vim.wo.spell = true
+
-- Bind <leader>+c to ci{ the last {} on the current line
-- e.g. <leader>+c would make \command{ahesifuhisg} \command{} with insert
vim.api.nvim_set_keymap('n', '<leader>c', '$bci{',
{ noremap = true, silent = true })
+
+-- Bind <leader>+d to duplicate the current line down
+vim.api.nvim_set_keymap('n', '<leader>d', 'yyp',
+ { noremap = true, silent = true })
diff --git a/home/starship.nix b/home/starship.nix
@@ -1,7 +0,0 @@
-{
- enable = true;
-
- settings = {
- add_newline = false;
- };
-}
diff --git a/home/zsh.nix b/home/zsh.nix
@@ -1,53 +0,0 @@
-{ pkgs, ... }:
-
-let editor = "nvim";
-in
-{
- enable = true;
-
- # use starship
-
- history = {
- path = ".cache/zsh/history";
- };
-
- # bind keys properly for backword or switch to vi mode??
-
- shellAliases = {
- ls = "ls --color=auto";
- l = "ls";
- la = "ls -la";
- grep = "grep --color=auto";
- v = editor;
- ga = "git add";
- gc = "git commit";
- gd = "git diff";
- gp = "git push";
- gs = "git status";
- tmux = "tmux -2";
- die = "shutdown now";
- };
-
- sessionVariables = {
- EDITOR = "nvim";
- NIX_PATH = "\$HOME/.nix-defexpr/channels\${NIX_PATH:+:}\$NIX_PATH";
- TERMINAL = "alacritty";
- };
-
- initExtra = ''
- . ~/.nix-profile/etc/profile.d/nix.sh
- '';
-
- plugins = [
- {
- name = "zsh-nix-shell";
- file = "nix-shell.plugin.zsh";
- src = pkgs.fetchFromGitHub {
- owner = "chisui";
- repo = "zsh-nix-shell";
- rev = "v0.1.0";
- sha256 = "0snhch9hfy83d4amkyxx33izvkhbwmindy0zjjk28hih1a9l2jmx";
- };
- }
- ];
-}