Explorar o código

Add pandoc autocmd, Clean some comments & spacing

Weiyi Lou %!s(int64=9) %!d(string=hai) anos
pai
achega
de71f339c8
Modificáronse 6 ficheiros con 23 adicións e 18 borrados
  1. 0 4
      shell/zsh/completion.zsh
  2. 4 4
      shell/zsh/grep.zsh
  3. 14 7
      shell/zsh/key-bindings.zsh
  4. 3 0
      vim/settings/templates.vim
  5. 1 0
      vim/templates/pandoc
  6. 1 3
      vim/vimrc

+ 0 - 4
shell/zsh/completion.zsh

@@ -32,10 +32,6 @@ compinit
 zmodload -i zsh/complist
 
 
-#?
-WORDCHARS=''
-
-
 # Case-insensitive completion.
 zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
 

+ 4 - 4
shell/zsh/grep.zsh

@@ -1,22 +1,22 @@
 # is x grep argument available?
 grep-flag-available() {
-    echo | grep $1 "" >/dev/null 2>&1
+  echo | grep $1 "" >/dev/null 2>&1
 }
 
 GREP_OPTIONS=""
 
 # color grep results
 if grep-flag-available --color=auto; then
-    GREP_OPTIONS+=" --color=auto"
+  GREP_OPTIONS+=" --color=auto"
 fi
 
 # ignore VCS folders (if the necessary grep flags are available)
 VCS_FOLDERS="{.bzr,CVS,.git,.hg,.svn}"
 
 if grep-flag-available --exclude-dir=.cvs; then
-    GREP_OPTIONS+=" --exclude-dir=$VCS_FOLDERS"
+  GREP_OPTIONS+=" --exclude-dir=$VCS_FOLDERS"
 elif grep-flag-available --exclude=.cvs; then
-    GREP_OPTIONS+=" --exclude=$VCS_FOLDERS"
+  GREP_OPTIONS+=" --exclude=$VCS_FOLDERS"
 fi
 
 # export grep settings

+ 14 - 7
shell/zsh/key-bindings.zsh

@@ -5,7 +5,7 @@
 # - terminfo - "smkx" and "rmkx"
 
 
-# Use vi-bindings in ZLE (Zsh Line Editor) for command editing
+# Use vi-bindings in ZLE (Zsh Line Editor) for command editing.
 bindkey -v
 
 
@@ -15,14 +15,13 @@ bindkey '^[[Z' reverse-menu-complete
 
 # Command line editing with text editor: `v` in vi-command mode or `<C-x><C-e>`.
 #
-# Load the `edit-command-line` function from an fpath folder.
-# e.g. /usr/share/zsh/*/functions
+# Load a function from an fpath folder. e.g. /usr/share/zsh/*/functions.
 autoload -Uz edit-command-line
 zle -N edit-command-line
-# `-N` creates a New user-defined widget that fires a given function.
-# OR if no function is given, the widget will fire a function of the same name.
-bindkey '\C-x\C-e' edit-command-line # Bind the widget to a key.
-bindkey -M vicmd v edit-command-line # Same, for a given keymap (vicmd).
+# `-N` creates a New user-defined widget that fires a function. In this case,
+# since no function is given, the widget will fire a function of the same name.
+bindkey '\C-x\C-e' edit-command-line # Bind the widget to keys.
+bindkey -M vicmd v edit-command-line # Same, but only for the `vicmd` keymap.
 
 
 # Make Ctrl-z also bring jobs back to the foreground.
@@ -64,3 +63,11 @@ if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
   zle -N zle-line-init   # Special Widget: runs before each new line of input.
   zle -N zle-line-finish # Special Widget: runs after input has been read.
 fi
+
+
+# Leaving this here because OMZ uses it without explanation, and it took some
+# experimentation to find out why. This setting affects what emacs keybindings
+# (e.g. M-b and M-f) consider a word. Setting this to an empty string means that
+# motions would stop at all non-alphanumeric characters. This is irrelevant for
+# vi keybindings which employ the concepts of "words" and "WORDS".
+#WORDCHARS=''

+ 3 - 0
vim/settings/templates.vim

@@ -8,3 +8,6 @@ autocmd BufWritePost *.sh if getline(1) =~ "^#!/" | silent !chmod +x <afile>
 " Template for makefiles.
 " Removes comments, places cursor at end of file.
 autocmd BufNewFile [Mm]akefile silent 0r ~/dotfiles/vim/templates/makefile | silent 4,$ g/^#/d | normal G
+
+" Template for pandoc files.
+autocmd BufNewFile *.pandoc silent 0r ~/dotfiles/vim/templates/pandoc | silent 0,$ g/^"/d | normal G

+ 1 - 0
vim/templates/pandocessay → vim/templates/pandoc

@@ -12,6 +12,7 @@ abstract: |
 # Bibliography
 
 ---
+" Record uncited references that should still appear in the bibliography here.
 nocite: |
 
 ---

+ 1 - 3
vim/vimrc

@@ -1,8 +1,6 @@
 " vim: set sw=2 ts=2 sts=2 et tw=80 fmr={{{,}}} fdl=0 fdm=marker:
 "
-" The Main Vim Config File
-"
-" Contains plugin-independent, have-anywhere settings and mappings.
+" Main Vim Config File
 "
 " Loads plugins from `~/dotfiles/plugins.vim`.
 " Loads additional settings from `~/dotfiles/vim/settings/*.vim`.