Giter Club home page Giter Club logo

homedir's People

Contributors

h-youhei avatar marwahaha avatar

Watchers

 avatar

Forkers

marwahaha

homedir's Issues

[rsync] set owner as dest's

rsync -rlpt

-a option is as -rlptgoD
-g preserve group, -o preserve owner, so dropping -go is the solution.

[zsh] show git status at prompt

core code to do it

setopt prompt_subst
autoload -Uz vcs_info
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:*' formats '%b'
zstyle ':vcs_info:*' actionformats '%b %a'
#this is called before showing prompt
precmd() {
	vcs_info
}
PROMPT='${vcs_info_msg_0_}'

[ivy] call kill buffer

In ivy switch buffer, when I call kill buffer action on current buffer item, the error appears.

Error in post-command-hook (ivy--exhibit): (error "Selecting deleted buffer")

The deleted item remain in ivy window. but actual it deleted.
After I close then reopen ivy window, the deleted item isn't there.

TODO: Does this happens also minimal configuration? If so I should report this upstream.

move etc to another repository

  • create repository

  • copy and edit locale.conf to sh_common

  • move etc/ to new repos

  • write install script that

    • can reuse helper/etc-install.sh, etc-update.sh
    • is required root privilege
    • uses rsync
  • write configuration for root user. that

    • should not use symlink to files that have normal privilege
    • should not source files that have normal privilege
  • remove scripts under helper/

[vim] open same file as readonly

this doesn't work expected such as, can open it without warning, but can edit it

:sview %<CR>

how to do it

copy current file to temp dir

open it as readonly

[vim,systemd] remove old undofile

delete undofile that passed more than 3 days since last modified per a week

vim

undodir is $XDG_DATA_HOME/nvim/undo

systemd

How do I get $HOME?

this is enough to try

Environment="HOME=/home/%u"

filesystem

how to get last modlfied date for script

#epoch is time since 1970y/1m/1d 0h:0m:0s
#shows last modified time as sec since epoch
stat -c %Y filename
#shows current time as sec since epoch
date +%s

current - last modified > 3 days

3 days = 60s * 60m * 24h * 3d = 259200 sec

[undo-tree] doesn't load undo history propery

this problem is similar

If I do some edit before undoing, undo-tree-auto-save-history is broken.

This step work properly

  1. open-file
  2. undo, redo or visualize
  3. some edit
  4. undo twice

This step doesn't work properly

  1. open file
  2. some edit
  3. undo twice

Reproduction step

emacs -Q

(package-initialize)
(require 'undo-tree)
(setq undo-tree-auto-save-history t)
(global-undo-tree-mode 1)

M-x find-file RET some-file RET
some edit
M-x save-buffer
M-x kill-emacs

emacs -Q

(package-initialize)
(require 'undo-tree)
(setq undo-tree-auto-save-history t)
(global-undo-tree-mode 1)

M-x find-file RET the file RET
some edit
M-x undo-tree-undo
M-x undo-tree-undo
Emacs complains "No further undo information".

Note

Arch Linux
Emacs 25.2.1 gtk
SSD
Undo-tree 20170706.246

config management style

Which is better "to edit config file directory then backup" or "to edit config file in repos then update"?

mozc

Requirement

start mode is hankaku
can control from script
work properly

IMF

start mode

ibus: hankaku
fcitx: zenkaku, but it can start with hankaku by adding english keyboard layout

on the spot

ibus: ok. But in terminal, convert window is always located in bottom left of parent window.
fcitx: can't

control from script

ibus engine
fcitx-remote

other

fcitx can't commit when it switch layout
setting change layout of ibus and activate ime of mozc to same key doesn't work

[zsh] cd git_root

cd `git rev-parse --show-toplevel 2>/dev/null`

2>/dev/null throw away error output

how to remain focus to minibuffer when I abort recursive edit

  1. ivy-switch-buffer
  2. rename
  3. abort recursive edit

now focus is on normal buffer.
I want focus to minibuffer.

this code doesn't work

(defun abort-recusive-edit-remain-focus ()
  (interactive)
  (abort-recursive-edit)
  (when (active-minibuffer-window)
    (select-window (active-minibuffer-window)))

[Emacs] Indent

How to write indent function?

How to have emacs respect manual indent like vim?

To insert tab manually, map tab-to-tab-stop to Tab

(define-key 'evil-insert-state-map [tab] #'tab-to-tab-stop)

But when I type Return, emacs remove manual indent.
So stop electric mode or not use electric mode for Return.

(electric-indent-mode 0)
; or
(setq electric-indent-chars (remq ?\n electric-indent-chars))

Sadly, if doing so, I can't get the benefits from emacs's auto indent.
Map newline-and-indent to Return so that I can be happy.

(define-key 'evil-insert-state-map [return] #'newline-and-indent)

Finally, I can indent manually and also get the benefits from emacs's auto indent.

It doesn't work to remove new line's auto indent when to leave insert state.

(defun evil-maybe-remove-spaces-fix (&optional do-remove)
  (if do-remove
    (progn
      (when (and
            evil-maybe-remove-spaces
            (save-excursion
              (beginning-of-line)
              (looking-at "^\\s-*$"))
         (delete-region (line-beginning-position) (line-end-position))))
         (setq evil-maybe-remove-spaces nil))
      (setq evil-maybe-remove-spaces (memq this-command '(
         evil-open-above
         evil-open-below
         evil-append
         evil-append-line
         newline
         newline-and-indent
         indent-and-newline)))))

(advice-add #'evil-maybe-remove-spaces :override #'evil-maybe-remove-spaces-fix)

memory leak?

sometimes PC freezes or crash Xserver.
I suspect xmonad or ibus-replace-with-kanji

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.