[solved] [VIM] question to vim power users about mapping

Hi,
I have just starting using map leaders in vim and I'm love it.
Here are my shortcuts but this method allow to open /etc/rc.conf only in readonly mode.
So how can I open this file to edit like su (when I open vim without sudo)? I have configured sudo to works without password.
" Fast editing
map <leader>v :e! ~/.vimrc<cr>
map <leader>b :e! ~/.bashrc<cr>
map <leader>r :e! /etc/rc.conf<cr>
Last edited by chmurli (2011-02-04 21:40:08)

I use
map ss :w !sudo tee % > /dev/null<CR>
when I open a file that needs 'sudo' for editing.
For some files I have aliases:
[karol@black ~]$ type rc
rc is aliased to `sudo vim /etc/rc.conf'
Last edited by karol (2011-02-03 21:45:57)

Similar Messages

  • Question to the Power Users RE: Time Capsule Disk Mgmt and Security

    I was real excited to get the Time Capsule, but now since I have it I have to say its lack of security and disk management features are disappointing.
    I am thinking of giving up on Time Machine backups completely (I have never been thrilled with TM) and using the Backup 3.0 that is available to .Mac users. If I backup one machine using TM to the TC, I can login from a different machine and modify/delete the backups, this is not secure from accidental or malicious access.
    What I am hoping to do is to create logical partitions on the drive and use a program like PGP to encrypt the disk. This so far has been a real pain in the @$$ because of the lack of disk mgmt with the TC.
    I have used the OS X disk utility to create a disk image (takes forever) and it does not automagically mount itself, so PGP will not recognize it is a disk. I then decided to start over and use the Airport Utility to erase the disk (this has been running for about 12 hours now, and is still flashing amber). I am not sure if this TC is DOA or just slow as cr@p.
    If anyone has any ideas on how to make an out of the box TC more secure, please share.

    darndawg wrote:
    Have you been able to get all of your applications to recognize the disk image as a place to save/create/modify files?
    All applications? Only tried some - but since I was able to copy 56GB of iTunes content to the drive and access it with TuneRanger - I am fairly certain it is universally available.
    With the encrypted disk image, can you decrypt that image from another machine with a passphrase? I believe the answer is no, which is why I want to use PGP to encrypt the disk image.
    I believe the image is not machine restricted. The only encrypted image I have is on a USB memory stick. I will have to try and open it on my other mac.
    I did create a 50GB disk image successfully, however I changed my mind and decided I wanted to create an image using the entire TC disk.
    I deleted the disk image I had created, as well as the TM backups on the disk. I then used the Airport Utility to do a "quick" erase of the disk, and now 36 hours later it is still erasing the disk.
    That sounds wrong.

  • [SOLVED] set columns in vim does not work

    I would like to set the window size of my vim to 95 when working with markdown files, so put
    set columns=95
    into an autosourced file when opening Markdown files. Unfortunately this has no effect and when I look at
    set columns?
    the window size is still 179 characters long.
    When I try to do
    set columns=95
    with vim already open, vim very shortly resizes the text/window, but after a second return to the original size which is 179 character (screen width)
    I tried ot figure out if it is a problem of my .vimrc by temporaliy working with a new empty .vimrc but the problem remains the same. I tried it out in another terminal emulator, but the problem remains the same. I tried it out logged in as root user before starting the XServer and here it worked as expected. So my gues is it has to do or with a X setting or with my window manager or with my shell.
    I am using i3, urxvt and zsh in the context where it didn't work and the Arch install default setting in the context where it works. Still I have no clue what causes the problem.
    Last edited by cutuchiqueno (2013-12-05 12:18:36)

    x33a wrote:I believe you'll need to float urxvt in i3 to do that.
    Thanks, I haven't thought of that possibility and it works. Although what I wanted to achieve is not possible with this solution though I found the Vimroom plugin which did the job, so thanks again.

  • [Solved] How to disable vim filetype indentation.

    Hello. I want to start using vim, but there is only that problem with that. In gedit I always use tabs 4 spaces wide for indentation, and I want to do something similar in vim. So in my .vimrc I used tabstop=4 and set autoindent. If I write a plain text file, it works correctly, for example, if I press tab in a new line, and the press enter, the following lines preserve the tab as indentation.
    The problem starts when writing code in common lisp or python. In lisp tab is replaced by two spaces and does some weird things, and in python tab is replaced by 4 spaces. I tried including "filetype indent off" in my vimrc, or writing ":filetype indent off" directly in console, but that doesn't have any effect. The only thing that somewhat works is to disable autodinent, but then I have to manually indent every line. What can I do?
    Last edited by Serge2702 (2014-11-06 20:57:54)

    I keep a skeleton vimrc file to use when I have a question similar to Serge2702's.  My barebones.vim:
    set nocompatible
    filetype plugin on
    set t_co=256 " Optional, you may comment this out.
    syntax on
    Start vim, using the alternate vimrc file with the command, say, for a lisp file: vim -u barebones.vim file_to_edit.lisp.
    Seems most filetypes default to a tab with a width of eight spaces here.  To see the tabs, you can use these two commands from within vim:
    :set list
    :set listchars=tab:_T
    Then you can try all the different setting combinations to figure out a comfortable tab width.
    And there are quite a few settings that affect the width of tabs and indentation besides tabstop. There's autoindent to repeat the previous line's indentation, but this is modified if you use cindent or smartindent to set the indent according to syntax. Then there are the expandtab and smarttab settings to use spaces for tabs, and shiftwidth and softtabstop also set indentation width. I don't see why anyone has trouble figuring it out.;)

  • [SOLVED] How to convince vim my terminal supports color?

    Hi. I recently got a shell account from Kaitocracy on his linode machine. I noticed that my bash prompt has color, as expected, but when I copied over my vim configuration (which includes a color theme), it didn't work! After some toying around, I noticed that vim recognizes the terminal escape codes using `:hi <type> start= stop=`, but not the existing `cterm` commands in my color theme. To make things more confusing, I know my terminal (urxvt) is capable of using the cterm flags.
    Also, Ctrl+L does not clear/redraw the screen as expected.
    What can I do to fix these issues? Here are the configs:
    ~/.vimrc:
    " No vi compatibility; strictly vim here.
    set nocompatible
    " Don't source /etc/vimrc
    set noexrc
    " My background is always black
    set background=dark
    " The mouse is helpful every now and then...
    set mouse=a
    " I'm a Linux user
    set fileformats=unix,dos,mac
    " Search while I type
    set incsearch
    " The blinking pisses me off
    set novisualbell
    " Line numbers are key to debugging
    set number
    set numberwidth=5
    " My tabs are 4 characters long
    set tabstop=4
    set softtabstop=4
    " Indention is also 4 characters
    set shiftwidth=4
    " Normally, I don't want tabs converted to spaces.
    set noexpandtab
    " Syntax highlighting is a staple :D
    syntax on
    " I want liberal use of hidden buffers, just in case.
    set hidden
    set laststatus=2
    " filename, filetype, readonly flag, modified flag line #, column #, %age of file length, hex value of byte under cursor.
    " Ex: .vimrc [vim][+] 48,22 55% hex:20
    set statusline=%f\ %y%r%m\ %l,%c\ %P\ hex:%B
    set noai
    " I can see where tabs and line endings are
    set listchars=tab:▸\ ,eol:¬
    " This turns on the config above; I can turn it off with :set nolist
    set list
    " I want wordwrap on, coupled with sane line-breaking. This will not work when :set list is active.
    set wrap
    set lbr
    " My color scheme is pwn
    colorscheme sporkbox
    filetype indent on
    if has("autocmd")
    " enable filetype detection
    filetype on
    " I want to convert tabs to spaces to adhere to PEP 8.
    autocmd FileType python setlocal ts=4 sts=4 sw=4 expandtab
    endif
    " \l toggles invisibles
    nmap <leader>l :set list!<CR>
    " I like to get rid of trailing white space.
    nnoremap <silent> <F5> :call <SID>StripTrailingWhitespaces()<CR>
    " Fast window movement is important
    map <C-h> <C-w>h
    map <C-j> <C-w>j
    map <C-k> <C-w>k
    map <C-l> <C-w>l
    " Courtesy of vimcasts.org
    function! <SID>StripTrailingWhitespaces()
    " Save last search and cursor position
    let _s=@/
    let l = line(".")
    let c = col(".")
    " Do the business:
    %s/\s\+$//e
    " Restore previous search history and cursor position
    let @/=_s
    call cursor(l, c)
    endfunction
    ~/.vim/colors/sporkbox.vim:
    " Color scheme "sporkbox"
    " by Daniel Campbell <[email protected]>
    " Tab characters and EOLs should be dark gray so they don't stand out too much.
    highlight SpecialKey ctermfg=darkgray
    highlight NonText ctermfg=darkgray
    " If I'm in a mode, I want to see it.
    highlight ModeMsg ctermfg=green
    " The current file should be obvious; the others can be faded.
    highlight StatusLine ctermfg=green ctermbg=black
    highlight StatusLineFC ctermfg=darkgray ctermbg=white
    " Line numbers should be just-visible, not bright.
    highlight LineNr ctermfg=darkgray
    " Titles in Markdown
    highlight Title cterm=bold ctermfg=white
    " My splits should not be bright
    highlight VertSplit ctermfg=black ctermbg=darkblue
    highlight Comment ctermfg=darkgreen
    highlight Constant ctermfg=cyan
    highlight Identifier ctermfg=yellow
    highlight Statement ctermfg=magenta
    highlight PreProc ctermfg=lightblue
    highlight Type ctermfg=blue
    highlight Special ctermfg=lightblue
    Remote .bashrc:
    ### ~/.bashrc: Sourced by all interactive bash shells on startup
    # Set a fancier prompt
    PS1='\[\e[32;01m\]\u\[\e[m\] \[\e[36m\]\w\[\e[m\]: '
    # Turn on colors for ls and grep
    alias less='less --RAW-CONTROL-CHARS'
    alias ls='ls --color=auto'
    alias grep='grep --color=auto'
    # Set colors for ls and friends
    if [ -f ~/.dir_colors ]; then
    eval `dircolors -b ~/.dir_colors`
    elif [ -f /etc/dir_colors ]; then
    eval `dircolors -b /etc/dir_colors`
    else eval `dircolors -b`; fi
    # Compilation optimization flags
    CHOST="i686-pc-linux-gnu"
    MAKEFLAGS="-j2"
    LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=both"
    CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"
    FFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"
    CPPFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"
    CXXFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"
    export PGHOST="private1.kiwilight.com"
    export PS1 CHOST MAKEFLAGS LDFLAGS CFLAGS FFLAGS CXXFLAGS
    To make matters more confusing, my vim theme works when I connect to the linode in a GNU screen session, but not when it's a straight-up terminal.
    Last edited by xelados (2010-04-25 00:34:44)

    Mr.Elendig wrote:Make sure you are using rxvt-unicode-256color and that your TERM is rxvt-256color outside of screen, and screen-256color inside of screen.
    That's the peculiarity of the problem; when I run vim in my local environment, I always get color using the `:hi <hilighttype> ctermfg=* ctermbg=*` commands. This applies inside of X through rxvt-unicode (non-256color), GNU screen, and on the plain command line in vc1. This issue seems to be related to the remote environment and/or variables not being sent through ssh.
    @moljac: When I echo'd TERM inside a screen session, it returned "screen", so I don't know whether it's legit or not.
    Last edited by xelados (2010-04-24 11:47:52)

  • Can Power Users or Mgt Create and Design Reports Through Query Designer ?

    Dear BI consultants,
    Iam new to BI.
    My management has requested me to Train Power users from All Modules(FICO,HR,QM,PP,SD,MM) to Create Queries and Design Through Query Designer.
    My question is are we suppose to Give query Designer Access to Power users or Mgt so that they can create Queries and reports by themselves.Please Suggest me wht is the Best Practices.
    is it feasable to train power users and Mgt as to how 2 create queries. will there be any side effect on the System or our end.
    Plz suggest.
    wht are the advantages and disadvantages of this.
    If I train the Power users then is there any risk of my Job.
    since they will be creating all reports by themselves.
    wht else can a BI consultant do since iam in a support project.
    how do i convince my Mgt?
    Plz Suggest.
    Thanks Awaiting

    This is common procedure maintained in most of the company's for end users.
    There is no issue if you train the power users.you will be the first point of contact if they have any doubts.and more over you are supporting for your client right? this can't be handed over to power user or end user. data is imp for the client so there will not be any problem for you, if any issue comes while loading you need to take care of the errors and fix the.
    power users or end user will be familiar with Business requirement not with the Query building logic's not with the BW procedure so no worries for you.
    as vineeth said its better to keep control regarding the global and key things at your end so that you will not loose contol on the reports.

  • Questions about Mapping GL Accounts to Group Accounts

    Hi,
    I have some questions about mapping gl accounts to group accounts while configuring OBIEE APPS 7.9.6.3 with EBS R12 as a source:
    FIRST QUESTION.-
    For file file_group_acct_codes_ora.csv, I have the following accounts from my customer:
    101101 - Caja Administrativa
    101102 - Fondo Revolvente
    101103 - Caja de Cambios
    101104 - Efectivo en cajero
    This group of accounts is named CASH, now my customer said that this group begins in 101101 and ends in 101199 but in this moment only have this 4 accounts in GL, the rest of the accounts, I mean 101105-101199 are not used right now, they are gonna used in the future.
    So, my question is, in file_group_acct_codes_ora.csv how I need to put this group:
    In this way:
    CHART OF ACCOUNTS ID,FROM ACCT,TO ACCT,GROUP_ACCT_NUM
    50308,101101,101104,CASH
    Or in this way:
    CHART OF ACCOUNTS ID,FROM ACCT,TO ACCT,GROUP_ACCT_NUM
    50308,101101,101199,CASH
    I mean, is there any problem if I use the second way, or is necessary to do it in the first way, and why?
    SECOND QUESTION.-
    For file file_group_acct_names.csv, when I update with a new group of accounts, is there any rule or size boundary for GROUP_ACCOUNT_NAME?
    THIRD QUESTION.-
    For file_group_acct_names.csv, what is the value in column LANGUAGE? I mean, is EBS language?, DB language?, server language?
    I hope that someone can help me, because I need to clarify this and don't do the first full load and this load ends with error because of this.
    Regards,
    Arnulfo

    I'll take some broad swipes at this and let the smarter people come fill in the details.
    We have a true 1:1 setup in our office and have moved to PHDs as a means of protecting against downtime. The thinking is that we will have a spare machine lying around with our base installation ready to go. If a user's machine fails we'll replace it with the spare machine, let it sync the user directory from the server, and we're back in business. It's no substitute for a real backup system, but it potentially avoids having to run a restore from your backups. It also reduces network traffic compared to plain networked homes, and still lets your users work if the server goes down, but provides the benefits of centralized management. John DeTroye wrote a nice article about this.
    If you've already got data on your "client" Mac you will need to move it onto the server. PHDs will download data from the server to the client on the first sync, but will not upload a complete home directory from the client to an empty directory on the server. You'll find some posts in this forum discussing how people have gone about migrating data prior to that first sync.
    WGM allows you to establish exclusions for stuff you don't want to sync.
    One thing to watch out for in the scenario you describe is the so-called "rabbit effect." Assume Bob uses Mac1 as his primary machine. If one day he logs into Mac2 his home directory will be downloaded to Mac2. Once he returns to Mac1 he'll still be cluttering up Mac2 with his data. If he logs into Mac3 the next day and Tom and Sue are also periodically logging into different machines, you can see how you'll end up with a mess pretty quickly.
    Hope this helps.

  • TS1538 Ask other users about this article

    I have connected 7th generation nano.  Computer recognizes.  itunes does not.  I have used all the troubleshooting tips except for the third party security checks, which totally scare me.  My computer has just been wiped, professionally.  In using the diagnostic checks, it says itunes doesnt recognize the ipod.  Can anyone help?  Am in the same boat with my ipod shuffle.  Computer and itunes do not recognize either.  I am frustrated beyond belief.  Have spent 3 days rebooting, restarting and troubleshooting.  HELP

    at4lv
    Jul 1, 2013 11:03 AM
    Ask other users about this article
    iPhone 4,  iOS 5.0.1
    I have this question too          (0)
    Reply
    Categories:  iPhone 4 (GSM)
    Tags (edit):                iphone,                     unlocked

  • HT1320 Ask other users about this article

    I have had an IPOD classic 160 for two years now and there has never been a software upgrade?
    Why can't the softwrae be updated to allow onboard editing, promotion demotion in a list, erasing and renaming of music files?
    Why does it have to be undertaken on a PC?
    Come on guys, do something for us old lags with classics please.
    Phil

    at4lv
    Jul 1, 2013 11:03 AM
    Ask other users about this article
    iPhone 4,  iOS 5.0.1
    I have this question too          (0)
    Reply
    Categories:  iPhone 4 (GSM)
    Tags (edit):                iphone,                     unlocked

  • Help me for solve this Question this is my problem

    help me for solve this Question this is my problem
    i installed EBS 11i fresh not vision
    i did cart of account and did set of book
    then assigned it with profile option gl set of books name
    and when enter to make ajournal appeare this messege
    [http://www9.0zz0.com/2009/10/06/03/232202588.jpg]
    [http://www9.0zz0.com/2009/10/06/03/634050066.jpg]

    Hi,
    Not sure why are you getting this kind of error (which is pointing to a URL with Jpg file) while creating a journal.
    Could you please bounce your server once and try..
    Please let us know if the error/warning stopping you to enter a journal in GL??
    We don't think profile option is a show stopper here.... We assume that you have assigned Sets of Books, MO: Operating unit & HR USer Profile option at Responsibility level correctly....
    Regards,
    S.P DASH

  • I am trying to use the "This solved my question - 10 points" and the "This helped me - 5 points" but they are NOT doing anything. How do I award the points ?

    I am trying to use the "This solved my question - 10 points" an the "This helped me - 5 points" but they are NOT doing anything. How do I award the points ?

    Are you talking about the "Legend" panel at the right of the window?
    Those text are just help texts explaining the reputation points. You can only award points, if you are the original poster of a question. Then you will see active buttons to award points below the answers you receive. See here for more information: https://discussions.apple.com/static/apple/tutorial/reputation.html
    Regards
    Léonie

  • Launching Labview as Power User starts installer

    I installed Labview 6.1 as admin on a Windows XP SP1 machine. I gave 'everyone' full control to C:\Program Files\National Instruments.
    Labview launches fine when I log in as an admin.
    When Labview is started when logged in with a Power User account, it launches Windows Installer and starts to give error messages it can not find the required package.
    When I make sure the LV CD is in the PC at that time, Labview does not give these errors, but starts to install something (doesn't say what). However, each time LV is launched: same installer messages.
    How do I get rid of these messages? It speaks for itself I can not leave the CD in the CD drive.
    Thanks,
    David.

    Hello,
    I have the same problem with LabView 7.1 under Windows 2000!!!! I installed LabView 7.1 with admin-rights and every time a power user starts LabView, it trys to install something and says "Please reboot ....." After the reboot nothing has changed. The power user has to click "no" about 10 times to prevent LabView from rebooting. After that it runs fine.
    Another problem occurs when the power user trys to restart or shut down the system. This takes about 3 minutes! I figured out that there is a LabView-task appearing and disappearing every 10 sec. in the task-manager during this ~3 minute period preventing the computer from shutting down (sounds strange?! - yes it is). I tried the previous hints about reconfiguring the windows-installer settings but nothing has changed!
    Anyone has an idea???
    Thanks
    Holger

  • HT204368 Ask other users about this article

    issue with my iphone 4s bluetooth. I'm unable to pair my phone with my Motorola S9 Headset. i have paired these two devices in the past and the pairing still works between my headset and my iphone 4.(i do unpair these 2 when trying to pair my 4s and said headset) I have done all the standard rebooting/ turning on& off of the phone and headset that you could imagine without result. this is what it looks like, I will turn on the headset, my phone will discover it, I will tap the icon that relates to the Motorola S9, and after a few seconds a message pops up informing me that the headset should be turned on and that I may need to enter a pairing code. ( there is no option for entering said code that I can find) Also, the same time the bluetooth stopped working for my headset, it also stopped working for my vehicle. to me, this is a phone issue not a device issue. oh, last thing, this all started after powering down my phone a number of times during air travel. any assistance would be appreciated...

    at4lv
    Jul 1, 2013 11:03 AM
    Ask other users about this article
    iPhone 4,  iOS 5.0.1
    I have this question too          (0)
    Reply
    Categories:  iPhone 4 (GSM)
    Tags (edit):                iphone,                     unlocked

  • Is there a way to notify/alert users about records from PSA

    Hi All,
    During transaction data load in BW 3.5 I am using the option" No update of transaction data if Master data does not exist" in the Infopackage.
    If any records don't meet this criteria they will show in different Request in PSA.
    My question: Is there a way to notify/alert users about these records from PSA?.
    Through process chain we can't send any alerts in this case as loads will not fail.
    Please help.
    Thank you.
    Sree

    Brian, Accepeted. We can not create Infoset on PSA.
    To create report on PSA, follow this.
    https://websmp104.sap-ag.de/~sapidb/011000358700008145112002
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/968dab90-0201-0010-c093-9d2a326969f1
    /message/5239445#5239445 [original link is broken]
    Thanks...
    Shambhu

  • X61 power user cannot change display DPI

    Hi,
    I have one X61 (7673-CH4) XP Pro and login a Power User, I want to change the DPI setting in display advanced setting properties,
    but this X61 notebook always prompt a dialog box "Windows Setup has not changed the requested setting, You may not have the required Administrator privilege to install or uninstall new files or drivers. please contact your Administrator".
    1. because this X61 is a domain computer, can not provide user in administrator rights, 
    2. I try updated last display driver (v6.14.10.4926)
    3. I try other general desktop PC login Power user can change about DPI setting no need administrator rights.
    Please give me advise solution allow user can change DPI
    Many thanks
    Filex

    Hi,
    Can you post a screenshot for this situation?
    Sometimes, the third party credential provider would lead to some issue like this, I suggest you check the
     current credential provider via the following path:
    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\SessionData\x\LastLoggedOnProvider
    You should compare the result with the values in the following path:
    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\credential providers
    If the current value is third party credential provider, try to disable it:
    To disable the provider add a REG_DWORD value "Disabled"=1 to that provider’s CLSID subkey.
    The provider will be disabled on the next session creation (sessions are created when you log off, switch users, or reboot.
    If you have any feedback on our support, please click
    here
    Alex Zhao
    TechNet Community Support

Maybe you are looking for

  • Is not abstract and does not override abstract method tablechanged

    I will remove all the gui code to make it shorter, but my problem lies with my InteractiveTableModelListener. public class Meet extends JPanel{   private static void createAndShowGUI() {         JFrame frame = new JFrame("MEET_dataTable");         fr

  • ConvertPDF :: toImage for PDF portfolio

    Can we convert all pages within a PDF portfolio by using ConvertPDF's toImage at once? Or do we have to get each file from the portfolio first, then invoke toImage against each sub-files? Thx, Keishichi

  • How to install AIR 3.6 SDK in FB 4.7 without breaking iOS apps

    i downloaded the the Air 3.6 SDK with compiler from the labs website, unpacked it on mac, put the contents into the AIRSDK folder under the com.adobe.flash.compiler... folder as specified.  relaunch FB 4.7, and it shows that the AIR SDK is now 3.6. 

  • How do i get siri on my ipod 4g?

         How do I get Siri on my IPod Touch 4G? Even if I already have the iOS update?

  • Run applet with object tag

    Hi people. I need your assistance in my problem. I try to run the simple applet (from Java Tutorial Documents): import java.applet.Applet; import java.awt.Graphics; public class HelloApplet extends Applet { public void paint(Graphics g) { g.drawStrin