I have a mapleader macro to sort IP addresses and delete leading 0 in IP addresses
let mapleader='ip'
map <leader>ips :%s/0\+\([0-9a-f]\)/\1/ | %sort n /.*\./ | %sort n /\.\d\+\./ | %sort n /\./ | %sort n u
This works but it always selects the whole text.
I am searching for a solution where I can visually select with V
lines and then call a map that only this lines get sorted.
How can I do this?
s/0\+\([0-9a-f]\)/\1/
turn102
into12
?