Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • M maximum-awesome
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 26
    • Issues 26
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 9
    • Merge requests 9
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Square
  • maximum-awesome
  • Merge requests
  • !70

Add force sudo shorthand

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/MZAWeb/patch-5 into master 11 years ago
  • Overview 9
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: MZAWeb

Add force sudo shorthand

Compare
  • master (base)

and
  • latest version
    5b45eb3c
    1 commit, 2 years ago

1 file
+ 3
- 0

    Preferences

    File browser
    Compare changes
vimrc
+ 3
- 0
  • View file @ 5b45eb3c

  • Edit in single-file editor

  • Open in Web IDE


@@ -60,6 +60,9 @@ nmap <leader>g :GitGutterToggle<CR>
nmap <leader>c <Plug>Kwbd
map <silent> <leader>V :source ~/.vimrc<CR>:filetype detect<CR>:exe ":echo 'vimrc reloaded'"<CR>
#in case you forgot to sudo
    • Brian Donovan
      Brian Donovan @eventualbuddha · 11 years ago
      Contributor

      Is this supposed to be " in case you forgot to sudo?

      • Please register or sign in to reply
    • Administrator
      Administrator @root · 11 years ago
      Author Contributor

      Created by: MZAWeb

      Yes, sorry.

      • Please register or sign in to reply
Please register or sign in to reply
cmap w!! %!sudo tee > /dev/null %
    • Brian Donovan
      Brian Donovan @eventualbuddha · 11 years ago
      Contributor

      Any reason not to use sudo cat > %?

      • Please register or sign in to reply
    • Administrator
      Administrator @root · 11 years ago
      Author Contributor

      Created by: MZAWeb

      see "understanding tee" in the first answer here:

      http://stackoverflow.com/questions/2600783/how-does-the-vim-write-with-sudo-trick-work

      • Please register or sign in to reply
    • Brian Donovan
      Brian Donovan @eventualbuddha · 11 years ago
      Contributor

      Oh, right, duh. I always seem to forget that it'd be the non-superuser writing to the file with cat. Thanks for the reminder!

      • Please register or sign in to reply
Please register or sign in to reply
" plugin settings
let g:ctrlp_match_window = 'order:ttb,max:20'
let g:NERDSpaceDelims=1
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
0
0 participants
Reference: kahun/awesome-sysadmin!160
Source branch: github/fork/MZAWeb/patch-5

Menu

Explore Projects Groups Snippets