Skip to content

Instantly share code, notes, and snippets.

function checkupdates --description 'alias checkupdates=checkupdates'
argparse -i --name=checkupdates 'h/help' 'j/json' -- $argv
or return 1
function _show_usage
command checkupdates --help | sed "s/^checkupdates.*\$/& + custom/" | grep -v "nosync"
echo '
Extra Options:
-j, --json json output'
functions -e _show_usage
@kuchida1981
kuchida1981 / bobthefish.fish
Created May 8, 2023 14:51
fish shell 設定
set -g theme_display_git yes
set -g theme_display_git_dirty yes
set -g theme_display_git_untracked yes
set -g theme_display_git_ahead_verbose no
set -g theme_display_git_dirty_verbose yes
set -g theme_display_git_stashed_verbose no
set -g theme_display_git_default_branch no
set -g theme_git_default_branches master main
set -g theme_git_worktree_support no
set -g theme_use_abbreviated_branch_name yes
Plug 'Vimjas/vim-python-pep8-indent'
Plug 'mattn/calendar-vim'
Plug 'dag/vim-fish'
" Plug 'github/copilot.vim'
Plug 'neovim/nvim-lspconfig'
Plug 'williamboman/mason.nvim'
Plug 'williamboman/mason-lspconfig.nvim'
# プリフィクスを C-l に変更
set-option -g prefix C-l
unbind-key C-b
bind-key C-l send-prefix
# デフォルトシェルを fish とする
set-option -g default-shell /usr/bin/fish
# r で .tmux.conf を再読み込み
bind r source-file ~/.tmux.conf \; display-message "Reloaded"
@kuchida1981
kuchida1981 / ubuntu-20.04-command-not-found.md
Last active July 25, 2021 13:47
Ubuntu 20.04 で command-not-found が機能しなくなった

Ubuntu 20.04 の command-not-found が動かなくなってた. いつからか不明.

$ /usr/lib/command-not-found emacs
Sorry, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/command-not-found/+filebug
Please include the following information with the report:

command-not-found version: 0.3
@kuchida1981
kuchida1981 / fish_greeting.fish
Last active July 7, 2021 14:41
fish shell 起動時にアップデート可能なパッケージ数を表示
function fish_greeting -d "What's up, fish?"
set_color $fish_color_autosuggestion
set new_packages (command checkupdates)
set new_packages_count (count $new_packages)
if [ $new_packages_count -gt 0 ]
if command echo $new_packages | command grep -q "\slinux\s[0-9]";
command echo (count $new_packages) packages can be upgraded. These packages require restarting system.
else
@kuchida1981
kuchida1981 / ttty_menu.py
Last active August 29, 2015 14:00
Tkinterネタ Menuのカスタマイズ
# coding: utf8
u""" Tkinter::Menu クラスのカスタマイズ
メニューのラベルに下線付きのショートカットを設定する場合、underline引数を指定し
しないといけない……。
menu_root.add_cascade(menu = menu_files, label = 'File', underline = 0)
面倒ですね。gettextでメニューラベルを複数の言語に対応するのも、現実的じゃない。
@kuchida1981
kuchida1981 / tttk.py
Created April 21, 2014 09:07
Tkinterネタ pack() のデフォルト動作を変える
# coding: utf8
u""" pack()によるウィジェット配置のデフォルト動作を変更する
`pack()` するときには、 `pack(expand = True, fill = BOTH)` とすること多いので
使用例
from tttk import *
@kuchida1981
kuchida1981 / doc.md
Created April 21, 2014 03:27
Tkinterネタ 新しいウィンドウの生成

Tkinter で新しいウィンドウ/ダイアログを生成する

新しいウィンドウを生成するにはどうしたらいいか? Toplevel() を使う。

from Tkinter import *

class Mainwindow(Frame):

def init(self, master = None, *args, **kwargs):

@kuchida1981
kuchida1981 / README.md
Created April 15, 2014 03:49
Google Test & CMake Example

Google Test & CMake Example