Skip to content

Instantly share code, notes, and snippets.

@djvs
Created November 30, 2014 21:58
Show Gist options
  • Save djvs/b5ddb96b8e67a65aa683 to your computer and use it in GitHub Desktop.
Save djvs/b5ddb96b8e67a65aa683 to your computer and use it in GitHub Desktop.
map <Home> :call LineHome()<CR>:echo<CR>
imap <Home> <C-R>=LineHome()<CR>
map ^[[1~ :call LineHome()<CR>:echo<CR>
imap ^[[1~ <C-R>=LineHome()<CR>
function! LineHome()
let x = virtcol('.')
echo virtcol('.')
if x == 0
execute "normal ^"
else
execute "normal 0"
endif
return "iumm"
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment