Compare commits

..

8 Commits

Author SHA1 Message Date
inkch
43660dabba nvim: fix unpaired brace 2024-01-17 11:25:36 +09:00
inkch
2a8645eb8e nvim: use telescope-fzf-native.nvim (for performance) 2024-01-17 11:23:14 +09:00
inkch
09db90af39 nvim: for telescope: add keymap <esc> for close 2024-01-17 11:21:41 +09:00
inkch
d8461b6aa9 nvim: remove settings for neovide 2024-01-17 11:21:01 +09:00
inkch
a22636cab8 add comments to .chezmoiignore 2024-01-17 11:19:50 +09:00
inkch
dcfb6648d1 use .hosttype for conditions 2024-01-17 11:18:44 +09:00
inkch
b86adbe790 fix chezmoi.toml: don't remove whitespace after prompt* function 2024-01-17 10:48:15 +09:00
inkch
9fd0e7831e fix chezmoi.toml (escape {{ and }}) 2024-01-17 10:47:25 +09:00
8 changed files with 33 additions and 19 deletions

View File

@ -6,10 +6,9 @@
[merge] [merge]
command = "nvim" command = "nvim"
args = ["-d", "{{ .Destination }}", "{{ .Source }}", "{{ .Target }}"] args = ["-d", "{{ `{{ .Destination }}` }}", "{{ `{{ .Source }}` }}", "{{ `{{ .Target }}` }}"]
{{- $choices := list "desktop" "laptop" "server" -}}
{{- $hosttype := promptChoiceOnce . "hosttype" "What type of host?" $choices -}}
{{- $choices := list "desktop" "laptop" "server" }}
{{ $hosttype := promptChoiceOnce . "hosttype" "What type of host" $choices }}
[data] [data]
hosttype = {{- $hosttype | quote -}} hosttype = {{- $hosttype | quote -}}

View File

@ -7,7 +7,8 @@ README.md
.config/tmux/bootstraps # note that the pattern is not `dot_config/tmux/bootstraps` .config/tmux/bootstraps # note that the pattern is not `dot_config/tmux/bootstraps`
{{- end }} {{- end }}
{{- if (and (ne .chezmoi.hostname "arch") (ne .chezmoi.hostname "buzz")) }} {{- if (not (eq .hosttype "desktop" "laptop")) }}
# Only for desktop or laptop (GUI)
.config/alacritty .config/alacritty
.config/conky .config/conky
.config/dunst .config/dunst
@ -22,6 +23,7 @@ README.md
{{- end }} {{- end }}
{{- if ne .chezmoi.osRelease.id "arch" }} {{- if ne .chezmoi.osRelease.id "arch" }}
# Other than Arch Linux
.config/paru .config/paru
{{- end }} {{- end }}

View File

@ -45,9 +45,9 @@ shape = "Block"
TERM = "xterm-256color" TERM = "xterm-256color"
[font] [font]
{{- if eq .chezmoi.hostname "arch" }} {{- if eq .hosttype "desktop" }}
size = 7.5 size = 7.5
{{- else if eq .chezmoi.hostname "buzz" }} {{- else if eq .hosttype "laptop" }}
size = 5.5 size = 5.5
{{- end }} {{- end }}

View File

@ -1,10 +1,3 @@
{{- if (or (eq .chezmoi.hostname "arch") (eq .chezmoi.hostname "buzz")) }}
if (vim.g.neovide) then
vim.g.neovide_scale_factor = 0.7
vim.g.neovide_cursor_animation_length = 0
end
{{- end }}
vim.cmd([[ vim.cmd([[
try try
if exists('+termguicolors') if exists('+termguicolors')
@ -58,7 +51,7 @@ vim.cmd(':ca mkdir. call mkdir(expand("%:p:h"), "p")')
vim.cmd(':ca W! w !sudo -A tee %') vim.cmd(':ca W! w !sudo -A tee %')
{{- end }} {{- end }}
{{- if (or (eq .chezmoi.hostname "arch") (eq .chezmoi.hostname "buzz")) }} {{- if (and (eq .hosttype "desktop" "laptop") (eq .chezmoi.os "linux")) }}
vim.cmd([[ autocmd InsertLeave * call system("fcitx5-remote -c") ]]) vim.cmd([[ autocmd InsertLeave * call system("fcitx5-remote -c") ]])
{{- end }} {{- end }}

View File

@ -0,0 +1 @@
return { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }

View File

@ -2,6 +2,23 @@ return {
'nvim-telescope/telescope.nvim', tag = '0.1.5', 'nvim-telescope/telescope.nvim', tag = '0.1.5',
dependencies = { 'nvim-lua/plenary.nvim' }, dependencies = { 'nvim-lua/plenary.nvim' },
config = function() config = function()
local actions = require("telescope.actions")
require('telescope').setup({
defaults = {
mappings = {
i = { ["<esc>"] = actions.close },
},
},
extensions = {
fzf = {
fuzzy = true,
override_generic_sorter = true,
override_file_sorter = true,
case_mode = "smart_case",
},
},
})
local builtin = require('telescope.builtin') local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>\'', builtin.marks, {}) vim.keymap.set('n', '<leader>\'', builtin.marks, {})
vim.keymap.set('n', '<leader>.', builtin.find_files, {}) vim.keymap.set('n', '<leader>.', builtin.find_files, {})
@ -10,5 +27,7 @@ return {
vim.keymap.set('n', '<leader>,,', builtin.buffers, {}) vim.keymap.set('n', '<leader>,,', builtin.buffers, {})
vim.keymap.set('n', '<leader>,;', builtin.command_history, {}) vim.keymap.set('n', '<leader>,;', builtin.command_history, {})
vim.keymap.set('n', '<leader>,?', builtin.search_history, {}) vim.keymap.set('n', '<leader>,?', builtin.search_history, {})
require("telescope").load_extension('fzf')
end end
} }

View File

@ -52,7 +52,7 @@ truncate_to_repo = false
truncation_symbol = "" truncation_symbol = ""
format = "[$path]($style)[$read_only]($read_only_style) " format = "[$path]($style)[$read_only]($read_only_style) "
{{- if (or (eq .chezmoi.hostname "arch") (eq .chezmoi.hostname "buzz")) }} {{- if eq .hosttype "desktop" "laptop" }}
[directory.substitutions] [directory.substitutions]
"/mnt/" = " " "/mnt/" = " "
"~/dev/" = "" "~/dev/" = ""

View File

@ -1,5 +1,5 @@
# 256 color # 256 color
{{- if (or (eq .chezmoi.hostname "arch") (eq .chezmoi.hostname "buzz")) }} {{- if eq .hosttype "desktop" "laptop" }}
set -g default-terminal "screen-256color" set -g default-terminal "screen-256color"
{{- else }} {{- else }}
set -g default-terminal "tmux-256color" set -g default-terminal "tmux-256color"
@ -83,7 +83,7 @@ bind-key p run "xsel -o | tmux load-buffer - ; tmux paste-buffer"
# Aesthetic # Aesthetic
########################### ###########################
{{- if (or (eq .chezmoi.hostname "arch") (eq .chezmoi.hostname "buzz")) }} {{- if eq .hosttype "desktop" "laptop" }}
set -g pane-active-border-style fg=yellow set -g pane-active-border-style fg=yellow
set -g message-command-style 'fg=#eeeeee bg=#333333 bold' set -g message-command-style 'fg=#eeeeee bg=#333333 bold'
set -g message-style 'fg=#eeeeee bg=#333333 bold' set -g message-style 'fg=#eeeeee bg=#333333 bold'
@ -114,7 +114,7 @@ set -g window-status-current-format ''
{{- if (or (eq .chezmoi.hostname "arch") (eq .chezmoi.hostname "buzz")) }} {{- if eq .hosttype "desktop" "laptop" }}
############################################### ###############################################
# local and nested remote tmux sessions # local and nested remote tmux sessions
# - https://www.freecodecamp.org/news/tmux-in-practice-local-and-nested-remote-tmux-sessions-4f7ba5db8795/ # - https://www.freecodecamp.org/news/tmux-in-practice-local-and-nested-remote-tmux-sessions-4f7ba5db8795/