updated uptime script to be fluent and replaced keybinds
This commit is contained in:
parent
034943ef7e
commit
24eee5670a
16
bin/up.sh
16
bin/up.sh
@ -1,4 +1,16 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
uptime=$(cat /proc/uptime | awk '{print $1 / 60; print $1 % 60}' | xargs printf '%d min %d sec' 2>/dev/null)
|
ft_seconds=$(cat /proc/uptime | awk '{print $1}' | xargs printf '%d' 2>/dev/null) # floored int total
|
||||||
echo "$uptime"
|
ft_minutes=$(($ft_seconds/60))
|
||||||
|
ft_hours=$(($ft_minutes/60))
|
||||||
|
|
||||||
|
echo $ft_hours $ft_minutes $ft_seconds
|
||||||
|
if [[ $ft_hours -gt 1 ]] ; then
|
||||||
|
# display with leading hours
|
||||||
|
rem_mins=$(($ft_minutes % 60)) # get remaining mins
|
||||||
|
printf '%dH %dM' $ft_hours $rem_mins
|
||||||
|
else
|
||||||
|
# display with leading minutes
|
||||||
|
rem_secs=$(($ft_seconds % 60)) # get remaining mins
|
||||||
|
printf '%dM %dS' $ft_minutes $rem_secs
|
||||||
|
fi
|
||||||
|
13
vimrc
13
vimrc
@ -10,6 +10,7 @@ set backspace=indent,eol,start
|
|||||||
|
|
||||||
" basics
|
" basics
|
||||||
set number
|
set number
|
||||||
|
let mapleader=' '
|
||||||
|
|
||||||
" setting color theme stuff
|
" setting color theme stuff
|
||||||
set background=dark
|
set background=dark
|
||||||
@ -41,8 +42,8 @@ autocmd StdinReadPre * let s:std_in=1
|
|||||||
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
|
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
|
||||||
|
|
||||||
" nerdtree binds
|
" nerdtree binds
|
||||||
nnoremap <silent> <C-n> :NERDTree<CR>
|
nnoremap <silent> <leader>n :NERDTree<CR>
|
||||||
nnoremap <silent> <C-t> :NERDTreeToggle<CR>
|
nnoremap <silent> <leader>t :NERDTreeToggle<CR>
|
||||||
" nnoremap <C-f> :NERDTreeFocus<CR> going to conflict with fzf and I dont use
|
" nnoremap <C-f> :NERDTreeFocus<CR> going to conflict with fzf and I dont use
|
||||||
" this anyway
|
" this anyway
|
||||||
|
|
||||||
@ -79,10 +80,10 @@ endif
|
|||||||
command! -bang -nargs=? -complete=dir Find
|
command! -bang -nargs=? -complete=dir Find
|
||||||
\ call fzf#vim#files(<q-args>, fzf#vim#with_preview({'options': ['--layout=reverse', '--info=inline']}), <bang>0)
|
\ call fzf#vim#files(<q-args>, fzf#vim#with_preview({'options': ['--layout=reverse', '--info=inline']}), <bang>0)
|
||||||
|
|
||||||
nnoremap <silent> ff :Find<CR>
|
nnoremap <silent> <leader>f :Find<CR>
|
||||||
nnoremap <silent> fh :Find $HOME<CR>
|
nnoremap <silent> <leader>h :Find $HOME<CR>
|
||||||
nnoremap <silent> fg :GFiles<CR>
|
nnoremap <silent> <leader>g :GFiles<CR>
|
||||||
nnoremap <silent> fs :GFiles?<CR>
|
nnoremap <silent> <leader>s :GFiles?<CR>
|
||||||
|
|
||||||
" tweaking timeout to quit instatnly via esc
|
" tweaking timeout to quit instatnly via esc
|
||||||
set ttimeout
|
set ttimeout
|
||||||
|
Loading…
x
Reference in New Issue
Block a user