aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkatherine <shmibs@airen-no-jikken.icu>2018-12-06 11:54:26 -0700
committerkatherine <shmibs@airen-no-jikken.icu>2018-12-06 11:54:26 -0700
commitd168ec3c5e04efb5f401cfcbe60c021093cd465b (patch)
treec0f85841b00f27d8d8b6b0b72df8491188326d24
parent8a1a6e410499cbc5c0685287847b290be7ccbba8 (diff)
downloaddotfiles-d168ec3c5e04efb5f401cfcbe60c021093cd465b.tar.gz
synchronise common prompts
the same across shell, iex, utop, but colour-coded and with a which thing and version hint
-rw-r--r--.iex.exs57
-rw-r--r--.ocamlinit4
-rw-r--r--.vimrc3
-rw-r--r--.zshrc4
4 files changed, 63 insertions, 5 deletions
diff --git a/.iex.exs b/.iex.exs
new file mode 100644
index 0000000..fcd3931
--- /dev/null
+++ b/.iex.exs
@@ -0,0 +1,57 @@
+defmodule IExConfigInit do
+
+ def init do
+ user = System.get_env "USER"
+
+ hostname = case :inet.gethostname do
+ {:ok, s} -> s
+ _ -> "?"
+ end
+
+ dir = case Elixir.File.cwd do
+ {:ok, s} -> s
+ _ -> "?"
+ end
+
+ home = System.get_env "HOME"
+
+ dir = if home do
+ dir = case Regex.compile("^" <> home) do
+ {:ok, r} -> Regex.replace r, dir, "~"
+ _ -> dir
+ end
+ dir
+ else
+ dir
+ end
+
+ Application.put_env(:elixir, :ansi_enabled, true)
+
+ IEx.configure(
+ colors: [enabled: true],
+ default_prompt: [
+ # "\e[1A",
+ "\e[G", # ANSI CHA, move cursor to column 1
+ :bright,
+ :white,
+ "ā”Œ[",
+ :magenta,
+ (if user, do: user <> "@", else: ""),
+ "elixir-",
+ Elixir.System.version,
+ "@",
+ hostname,
+ " ",
+ :blue,
+ dir,
+ :white,
+ "]\n",
+ "ā””:",
+ :reset
+ ] |> IO.ANSI.format |> IO.chardata_to_string
+ )
+ end
+
+end
+
+IExConfigInit.init
diff --git a/.ocamlinit b/.ocamlinit
index a125263..4ff80ec 100644
--- a/.ocamlinit
+++ b/.ocamlinit
@@ -14,12 +14,14 @@ let path =
else
path
in
+let user = Unix.getlogin () in
let version = Sys.ocaml_version in
let host = Unix.gethostname () in
let formatted = LTerm_text.eval
[B_bold true;
B_fg (LTerm_style.white); S "ā”Œ[";
- B_fg (LTerm_style.lmagenta); S (Printf.sprintf "ocaml-%s@%s " version host);
+ B_fg (LTerm_style.lyellow); S (Printf.sprintf "%s@" user);
+ S (Printf.sprintf "ocaml-%s@%s " version host);
B_fg (LTerm_style.lcyan); S (Printf.sprintf "%s" path);
B_fg (LTerm_style.white); S "]\nā””: "]
in UTop.prompt := fst (React.S.create formatted);;
diff --git a/.vimrc b/.vimrc
index af4a7f8..fd0e121 100644
--- a/.vimrc
+++ b/.vimrc
@@ -22,7 +22,6 @@ Plugin 'elixir-lang/vim-elixir'
Plugin 'plasticboy/vim-markdown'
Plugin 'shmibs/mips.vim'
Plugin 'zah/nim.vim'
-Plugin 'wlangstroth/vim-racket'
Plugin 'rust-lang/rust.vim'
Plugin 'cakebaker/scss-syntax.vim'
Plugin 'cespare/vim-toml'
@@ -71,7 +70,7 @@ nmap ga <Plug>(EasyAlign)
set ttimeoutlen=100
"toggle gundo pane
-nnoremap <Leader>u :GundoToggle<CR>
+nnoremap <Leader>g :GundoToggle<CR>
"snippet bindings
let g:UltiSnipsExpandTrigger='<tab>'
diff --git a/.zshrc b/.zshrc
index 1f6971c..903185d 100644
--- a/.zshrc
+++ b/.zshrc
@@ -52,7 +52,7 @@ PROMPT+="%(0?..$fg[red]%?$fg[black]:)"
# if any, number of jobs
PROMPT+="%(1j.$fg[green]%j$fg[black]:.)"
# name and host (red for root)
-PROMPT+="%{%(!.$fg[red].$fg[magenta])%}%n@%M%E "
+PROMPT+="%{%(!.$fg[red].$fg[white])%}%n@zsh-$ZSH_VERSION@%M%E "
# current location, with one level of parent context
PROMPT+="%{$fg[blue]%}%2c"
# newline
@@ -66,7 +66,7 @@ PROMPT+="%(0?..$fg[red]%?$fg[white]:)"
# if any, number of jobs
PROMPT+="%(1j.$fg[green]%j$fg[white]:.)"
# name and host (red for root)
-PROMPT+="%{%(!.$fg[red].$fg[magenta])%}%n@%M%E "
+PROMPT+="%{%(!.$fg[red].$fg[white])%}%n@zsh-$ZSH_VERSION@%M%E "
# current location, with one level of parent context
PROMPT+="%{$fg[blue]%}%2c"
# newline