In this article, I will share some of my experience on installing NVIDIA driver and CUDA on Linux OS. Here I mainly use Ubuntu as example. Comments for CentOS/Fedora are also provided as much as I can.
inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>a | |
function! s:align() | |
let p = '^\s*|\s.*\s|\s*$' | |
if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p) | |
let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g')) | |
let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*')) | |
Tabularize/|/l1 | |
normal! 0 | |
call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.')) |
#!/bin/sh | |
ProgName=$(basename $0) | |
sub_help(){ | |
echo "Usage: $ProgName <subcommand> [options]\n" | |
echo "Subcommands:" | |
echo " bar Do bar" | |
echo " baz Run baz" | |
echo "" |
Vim provides built-in mechanisms to search through projects in the form of the grep
command.
However, on large projects, grep is known to be slow; and hence people have been switching to simpler searchers like ack, and faster, parallel (metal?) searchers like ag and pt.
Correspondingly, several plugins have been created that integrate these tools in vim: ack.vim, ag.vim, etc.
However, it's actually very easy to get the functionalities these plugins provide (faster search, results in quickfix-window, jumps, previews, and so on) in vanilla Vim itself; in fact, Vim already populates the grep-search results in a quickfix window. We just need to tell Vim to do the following things (use-case: ag):
- Use ag as the default grep program
- Open quickfix window by default
- Create mappin
#!/bin/bash | |
# update apt-get | |
export DEBIAN_FRONTEND="noninteractive" | |
sudo apt-get update | |
# remove previously installed Docker | |
sudo apt-get remove docker docker-engine docker.io* lxc-docker* | |
# install dependencies 4 cert |
KDE's document viewer Okular renders
markdown as HTML
(and reloads it automatically on changes.) Thus, simply open the
markdown file currently edited in Vim in Okular to be all set!
To start an GUI application from Vim, without freezing, hit-<enter>
prompts or scrambling screen lines, one can add a command such as
if has('unix')
command! -complete=shellcmd -nargs=1 -bang Silent execute ':silent !' . (0 ? 'nohup ' . . '/dev/null 2>&1 &' : ) | execute ':redraw!'