aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/cheat/suda.vim
diff options
context:
space:
mode:
Diffstat (limited to 'dotfiles/cheat/suda.vim')
-rw-r--r--dotfiles/cheat/suda.vim20
1 files changed, 20 insertions, 0 deletions
diff --git a/dotfiles/cheat/suda.vim b/dotfiles/cheat/suda.vim
new file mode 100644
index 0000000..2d6d274
--- /dev/null
+++ b/dotfiles/cheat/suda.vim
@@ -0,0 +1,20 @@
+" Open a current file with sudo
+:e suda://%
+
+" Save a current file with sudo
+:w suda://%
+
+" Edit /etc/sudoers
+:e suda:///etc/sudoers
+
+" Read /etc/sudoers (insert content under the cursor)
+:r suda:///etc/sudoers
+
+" Read /etc/sudoers at the end
+:$r suda:///etc/sudoers
+
+" Write contents to /etc/profile
+:w suda:///etc/profile
+
+" Save contents to /etc/profile
+:saveas suda:///etc/profile