Compare commits

..

No commits in common. "8cdd8621337d4be3435e3967c887fca36e46721d" and "fb20c944ca2a1b5a72f46c8d22e28c1562f45e54" have entirely different histories.

7 changed files with 115 additions and 88 deletions

View file

@ -33,15 +33,15 @@ This is better than the `C-x +` and C-x - because this is global to emacs not
just in in the current buffer."
(interactive "nFont Size: ")
(setq aa-font "Hasklug Nerd Font")
(setq aa-v-font "Hasklug Nerd Font")
(setq aa-font "Hack Nerd Font Mono")
(setq aa-v-font "ETBembo")
(set-face-attribute 'default nil :font aa-font :height a-font-size)
(set-face-attribute 'fixed-pitch nil :font aa-font :height a-font-size)
(set-face-attribute 'variable-pitch nil :font aa-v-font :height (+ a-font-size 30) :weight 'regular))
;; Set the default font size when emacs starts
(aa/set-font 120)
(aa/set-font 100)
(use-package all-the-icons
:straight t
@ -95,6 +95,7 @@ just in in the current buffer."
(require 'org-tempo)
(require 'ob)
(add-hook 'org-mode-hook 'variable-pitch-mode)
(use-package ob-nushell
:straight '(ob-nushell :type git :host github :repo "ln-nl/ob-nushell")
@ -231,7 +232,7 @@ just in in the current buffer."
`((,(concat (file-name-as-directory org-directory) "Todo.org") :maxlevel . 1)))
(add-hook 'org-mode-hook (lambda ()
(visual-line-mode)
(electric-pair-mode)
(org-indent-mode)
(flyspell-mode)))

View file

@ -1,8 +1,3 @@
if ((sys host | get name) == "Windows") {
$env.HOME = $env.USERPROFILE
$env.USER = $env.USERNAME
}
use path.nu *
use fzf.nu *
@ -10,6 +5,9 @@ use neovim.nu *
use prompt.nu *
use sapling.nu *
use nvm.nu *
use rvm.nu *
nvm use default
$env.config = {
show_banner: false,
@ -17,16 +15,10 @@ $env.config = {
env_change: {
PWD: [
{|_, after| nvm dir-hook $after }
{|_, after| rvm-dir-hook $after }
{|_, after| node-modules-dir-hook $after }
]
}
}
}
$env.config.show_banner = false
$env.config.shell_integration.osc133 = false
if $env.OS_THEME == "Light" {
use std/config light-theme
$env.config.color_config = (light-theme)
}

View file

@ -1,13 +1,84 @@
def 'nvm path' [subdir?: string]: nothing -> string {
if ($subdir | into string | str length) == 0 {
return $"($env.HOME)/.nvm"
}
$"($env.HOME)/.nvm/($subdir)"
}
export def 'nvm get-alias' [alias: string]: nothing -> string {
mut alias_version = if ($alias | find "stable" | is-not-empty) {
["lts/*"]
} else {
nvm aliases | where {|x| $x == $alias}
}
if $alias_version == ["stable"] {
$alias_version = ["lts/*"]
}
if ($alias_version | is-empty) {
return null
}
if ($alias_version | length) > 1 {
$alias_version = [$"($alias_version | first)/*"]
}
let version = (open ([(nvm path "alias"), ($alias_version | first)] | path join)) | str trim
if not ($version | str starts-with "v") {
return (nvm get-alias $version)
}
$version
}
def 'nvm index' [] {
http get 'https://nodejs.org/dist/index.json' | get version
}
export def 'nvm aliases' [] {
ls -a ...(glob (nvm path "alias/**/*"))
| each {|p| $p.name | path relative-to (nvm path "alias") }
| filter {|p| not ($p | str ends-with "*")}
| uniq
}
export def 'nvm list' [] {
ls -a (nvm path "versions/node")
| each {|p| $p.name | path relative-to (nvm path "versions/node") }
| filter {|p| not ($p | str ends-with "*")}
}
export def 'nvm resolve' [version: string] {
let resolved_version = (nvm list | find $version)
let resolved_alias = (nvm get-alias $version)
if (($resolved_version | length) != 1) and ($resolved_alias | is-empty) {
(error make --unspanned { msg: $"Unable to resolve '($version)'" })
}
if not ($resolved_version | is-empty) {
$resolved_version | first
} else {
$resolved_alias
}
}
export def --env 'nvm use' [version: string] {
let resolved = (nvm resolve $version)
let node_path = [(nvm path "versions/node") $resolved] | path join
$env.PATH = $env.PATH
| split row ":"
| where {|x| not ($x | str starts-with (nvm path "versions/node"))}
| prepend ([$node_path "bin"] | path join)
| str join ":"
}
export def --env 'nvm dir-hook' [dir: string] {
let file = $"($dir)/.nvmrc"
if ($file | path exists) and ($file | path type) == "file" {
let version = (open $file | lines | get 0 | str trim)
if (nvm list | find $version | is-empty) {
nvm install $version
nvm use $version
npm i -g typescript-language-server typescript emmet-ls cspell vscode-langservers-extracted yarn
} else {
nvm use $version | complete | ignore
}
nvm use (open $file | lines | get 0) | str trim
}
}

View file

@ -1,22 +1,20 @@
export-env {
$env.GOPATH = if ($env.COMPUTERNAME == "LAFITE") {
$"D:/Code"
} else {
$"($env.HOME)/Code"
}
$env.GOPATH = $"($env.HOME)/Code"
$env.PATH = $env.PATH
| split row ":"
| prepend ([$env.HOME ".cargo" "bin"] | path join)
| str join ":"
}
export def --env node-modules-dir-hook [dir: string] {
let nodePath = ([$dir, "node_modules", ".bin"] | path join)
if ($nodePath | path exists) {
$env.PATH = $env.PATH
| split row ":"
| where {|x| not ($x | str contains "node_modules")}
| prepend $nodePath
| str join ":"
}
}

View file

@ -1,11 +1,9 @@
" Set color theme based on the OS theme
if $OS_THEME ==# 'Dark'
set background=dark
colorscheme tairiki
else
set background=light
colorscheme tairiki
end
" Set color theme
lua << EOF
require("nord").setup({})
EOF
colorscheme nord
" Set tailing white space to errors
match ErrorMsg '\s\+$'

View file

@ -1,2 +1,10 @@
" The most basic status line ever
set statusline=\ %y%r\ %m%f:%l:%c%=
function GitStatus()
return trim(system("git diff --shortstat 2> /dev/null | awk '{print \"+\"$4\" -\"$6}'"))
endfunction
function GitBranch()
return trim(system("git rev-parse --abbrev-ref HEAD 2> /dev/null || echo 'no-git'"))
endfunction
set statusline=\ %y%r\ %m%f:%l:%c%=[%{GitBranch()}]\ %{GitStatus()}\

View file

@ -1,54 +1,17 @@
local wezterm = require "wezterm"
function scheme_for_appearance(appearance)
if appearance:find 'Dark' then
return 'Tomorrow Night'
else
return 'Tomorrow'
end
end
local scheme = wezterm.get_builtin_color_schemes()
local theme = scheme[scheme_for_appearance(wezterm.gui.get_appearance())]
function collect_executables(process)
local executables = {}
if process.executable then
table.insert(executables, process.executable)
end
if process.ppid and process.ppid > 0 then
local parent_process = wezterm.procinfo.get_info_for_pid(process.ppid)
if parent_process then
local parent_executables = collect_executables(parent_process)
for _, exe in ipairs(parent_executables) do
table.insert(executables, exe)
end
end
end
return executables
end
local function matches_editor(process)
local executables = collect_executables(process)
for _, executable in ipairs(executables) do
if string.match(executable, "vim") or string.match(executable, "emacs") then
return true
end
end
return false
end
local theme = scheme["Poimandres"]
local function vim_pass_though_action(config)
return {
key = config.key,
mods = config.mods,
action = wezterm.action_callback(function(win, pane)
local process_name = pane:get_foreground_process_name()
-- If we are in vim then we want to send the key to go to the net pain
if matches_editor(pane:get_foreground_process_info()) then
if string.match(process_name, "vim") or string.match(process_name, "emacs") then
win:perform_action({ SendKey = { key = config.key, mods = config.mods } }, pane)
return
end
@ -63,15 +26,11 @@ return {
-- You will need to install the beta version of the font to get the ligatures
-- https://github.com/intel/intel-one-mono/issues/9#issuecomment-1994958719
font = wezterm.font {
family = "Hasklug Nerd Font Mono",
},
set_environment_variables = {
OS_THEME = wezterm.gui.get_appearance()
family = "FiraCode Nerd Font Mono",
},
-- -- The nord theme to fit with everyting else
color_scheme = scheme_for_appearance(wezterm.gui.get_appearance()),
color_scheme = "Poimandres",
colors = {
tab_bar = {
background = theme.background,
@ -116,7 +75,7 @@ return {
audible_bell = "Disabled",
-- Have a really clean UI when there is only one tab open
hide_tab_bar_if_only_one_tab = true,
hide_tab_bar_if_only_one_tab = false,
-- Disabled all the padding, this makes vim look a lot nicer when all the
-- window bars go to the edges of the terminal