Compare commits
5 commits
fb20c944ca
...
8cdd862133
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8cdd862133 | ||
|
|
2b73b75ad3 | ||
|
|
adf01758f0 | ||
|
|
42cbeed7de | ||
|
|
18ce1c8695 |
7 changed files with 88 additions and 115 deletions
|
|
@ -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."
|
just in in the current buffer."
|
||||||
(interactive "nFont Size: ")
|
(interactive "nFont Size: ")
|
||||||
|
|
||||||
(setq aa-font "Hack Nerd Font Mono")
|
(setq aa-font "Hasklug Nerd Font")
|
||||||
(setq aa-v-font "ETBembo")
|
(setq aa-v-font "Hasklug Nerd Font")
|
||||||
|
|
||||||
(set-face-attribute 'default nil :font aa-font :height a-font-size)
|
(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 '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-face-attribute 'variable-pitch nil :font aa-v-font :height (+ a-font-size 30) :weight 'regular))
|
||||||
|
|
||||||
;; Set the default font size when emacs starts
|
;; Set the default font size when emacs starts
|
||||||
(aa/set-font 100)
|
(aa/set-font 120)
|
||||||
|
|
||||||
(use-package all-the-icons
|
(use-package all-the-icons
|
||||||
:straight t
|
:straight t
|
||||||
|
|
@ -95,7 +95,6 @@ just in in the current buffer."
|
||||||
(require 'org-tempo)
|
(require 'org-tempo)
|
||||||
(require 'ob)
|
(require 'ob)
|
||||||
|
|
||||||
(add-hook 'org-mode-hook 'variable-pitch-mode)
|
|
||||||
|
|
||||||
(use-package ob-nushell
|
(use-package ob-nushell
|
||||||
:straight '(ob-nushell :type git :host github :repo "ln-nl/ob-nushell")
|
:straight '(ob-nushell :type git :host github :repo "ln-nl/ob-nushell")
|
||||||
|
|
@ -232,7 +231,7 @@ just in in the current buffer."
|
||||||
`((,(concat (file-name-as-directory org-directory) "Todo.org") :maxlevel . 1)))
|
`((,(concat (file-name-as-directory org-directory) "Todo.org") :maxlevel . 1)))
|
||||||
|
|
||||||
(add-hook 'org-mode-hook (lambda ()
|
(add-hook 'org-mode-hook (lambda ()
|
||||||
(electric-pair-mode)
|
(visual-line-mode)
|
||||||
(org-indent-mode)
|
(org-indent-mode)
|
||||||
(flyspell-mode)))
|
(flyspell-mode)))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
if ((sys host | get name) == "Windows") {
|
||||||
|
$env.HOME = $env.USERPROFILE
|
||||||
|
$env.USER = $env.USERNAME
|
||||||
|
}
|
||||||
|
|
||||||
use path.nu *
|
use path.nu *
|
||||||
|
|
||||||
use fzf.nu *
|
use fzf.nu *
|
||||||
|
|
@ -5,9 +10,6 @@ use neovim.nu *
|
||||||
use prompt.nu *
|
use prompt.nu *
|
||||||
use sapling.nu *
|
use sapling.nu *
|
||||||
use nvm.nu *
|
use nvm.nu *
|
||||||
use rvm.nu *
|
|
||||||
|
|
||||||
nvm use default
|
|
||||||
|
|
||||||
$env.config = {
|
$env.config = {
|
||||||
show_banner: false,
|
show_banner: false,
|
||||||
|
|
@ -15,10 +17,16 @@ $env.config = {
|
||||||
env_change: {
|
env_change: {
|
||||||
PWD: [
|
PWD: [
|
||||||
{|_, after| nvm dir-hook $after }
|
{|_, after| nvm dir-hook $after }
|
||||||
{|_, after| rvm-dir-hook $after }
|
|
||||||
{|_, after| node-modules-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)
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,84 +1,13 @@
|
||||||
|
|
||||||
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] {
|
export def --env 'nvm dir-hook' [dir: string] {
|
||||||
let file = $"($dir)/.nvmrc"
|
let file = $"($dir)/.nvmrc"
|
||||||
if ($file | path exists) and ($file | path type) == "file" {
|
if ($file | path exists) and ($file | path type) == "file" {
|
||||||
nvm use (open $file | lines | get 0) | str trim
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,22 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export-env {
|
export-env {
|
||||||
$env.GOPATH = $"($env.HOME)/Code"
|
$env.GOPATH = if ($env.COMPUTERNAME == "LAFITE") {
|
||||||
|
$"D:/Code"
|
||||||
|
} else {
|
||||||
|
$"($env.HOME)/Code"
|
||||||
|
}
|
||||||
$env.PATH = $env.PATH
|
$env.PATH = $env.PATH
|
||||||
| split row ":"
|
|
||||||
| prepend ([$env.HOME ".cargo" "bin"] | path join)
|
| prepend ([$env.HOME ".cargo" "bin"] | path join)
|
||||||
| str join ":"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export def --env node-modules-dir-hook [dir: string] {
|
export def --env node-modules-dir-hook [dir: string] {
|
||||||
let nodePath = ([$dir, "node_modules", ".bin"] | path join)
|
let nodePath = ([$dir, "node_modules", ".bin"] | path join)
|
||||||
if ($nodePath | path exists) {
|
if ($nodePath | path exists) {
|
||||||
$env.PATH = $env.PATH
|
$env.PATH = $env.PATH
|
||||||
| split row ":"
|
|
||||||
| where {|x| not ($x | str contains "node_modules")}
|
| where {|x| not ($x | str contains "node_modules")}
|
||||||
| prepend $nodePath
|
| prepend $nodePath
|
||||||
| str join ":"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
" Set color theme
|
" Set color theme based on the OS theme
|
||||||
lua << EOF
|
if $OS_THEME ==# 'Dark'
|
||||||
require("nord").setup({})
|
set background=dark
|
||||||
EOF
|
colorscheme tairiki
|
||||||
|
else
|
||||||
colorscheme nord
|
set background=light
|
||||||
|
colorscheme tairiki
|
||||||
|
end
|
||||||
|
|
||||||
" Set tailing white space to errors
|
" Set tailing white space to errors
|
||||||
match ErrorMsg '\s\+$'
|
match ErrorMsg '\s\+$'
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,2 @@
|
||||||
" The most basic status line ever
|
" The most basic status line ever
|
||||||
function GitStatus()
|
set statusline=\ %y%r\ %m%f:%l:%c%=
|
||||||
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()}\
|
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,54 @@
|
||||||
local wezterm = require "wezterm"
|
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 scheme = wezterm.get_builtin_color_schemes()
|
||||||
local theme = scheme["Poimandres"]
|
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 function vim_pass_though_action(config)
|
local function vim_pass_though_action(config)
|
||||||
return {
|
return {
|
||||||
key = config.key,
|
key = config.key,
|
||||||
mods = config.mods,
|
mods = config.mods,
|
||||||
action = wezterm.action_callback(function(win, pane)
|
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 we are in vim then we want to send the key to go to the net pain
|
||||||
if string.match(process_name, "vim") or string.match(process_name, "emacs") then
|
if matches_editor(pane:get_foreground_process_info()) then
|
||||||
win:perform_action({ SendKey = { key = config.key, mods = config.mods } }, pane)
|
win:perform_action({ SendKey = { key = config.key, mods = config.mods } }, pane)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -26,11 +63,15 @@ return {
|
||||||
-- You will need to install the beta version of the font to get the ligatures
|
-- 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
|
-- https://github.com/intel/intel-one-mono/issues/9#issuecomment-1994958719
|
||||||
font = wezterm.font {
|
font = wezterm.font {
|
||||||
family = "FiraCode Nerd Font Mono",
|
family = "Hasklug Nerd Font Mono",
|
||||||
|
},
|
||||||
|
|
||||||
|
set_environment_variables = {
|
||||||
|
OS_THEME = wezterm.gui.get_appearance()
|
||||||
},
|
},
|
||||||
|
|
||||||
-- -- The nord theme to fit with everyting else
|
-- -- The nord theme to fit with everyting else
|
||||||
color_scheme = "Poimandres",
|
color_scheme = scheme_for_appearance(wezterm.gui.get_appearance()),
|
||||||
colors = {
|
colors = {
|
||||||
tab_bar = {
|
tab_bar = {
|
||||||
background = theme.background,
|
background = theme.background,
|
||||||
|
|
@ -75,7 +116,7 @@ return {
|
||||||
audible_bell = "Disabled",
|
audible_bell = "Disabled",
|
||||||
|
|
||||||
-- Have a really clean UI when there is only one tab open
|
-- Have a really clean UI when there is only one tab open
|
||||||
hide_tab_bar_if_only_one_tab = false,
|
hide_tab_bar_if_only_one_tab = true,
|
||||||
|
|
||||||
-- Disabled all the padding, this makes vim look a lot nicer when all the
|
-- Disabled all the padding, this makes vim look a lot nicer when all the
|
||||||
-- window bars go to the edges of the terminal
|
-- window bars go to the edges of the terminal
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue