Gvim and vim cursor

When we press insert or i in gvim the cursor shape changes from a fat block to thin and back to fat state when esc  is pressed. But I also want this behavior in vim, is it possible to set that in vim. I am using sakura as terminal.

Have a look at the t_EI and t_SI options.
I have these lines in my .vimrc for changing the cursor color depending on the mode
if &term =~ "rxvt-unicode"
"Set the cursor white in cmd-mode and orange in insert mode
let &t_EI = "\<Esc>]12;white\x9c"
let &t_SI = "\<Esc>]12;orange\x9c"
"We normally start in cmd-mode
silent !echo -e "\e]12;white\x9c"
endif
The escape codes are terminal dependent, I use urxvt. Have a look at the documentation of sakura if it allows to change the cursor shape.
Edit: Corrected the test from general rxvt to rxvt-unicode (also in my .vimrc! :-))
Last edited by davvil (2008-12-05 17:08:05)

Similar Messages

  • Configuring Terminal xterm and Vim

    I have spent some time customizing Terminal (version 2.1.1) and Vim using the files .profile, .bash_profile and .vimrc using the GNU tools that include ls. Everything went well except that I was unable to use the +cursorshape feature in the version of Vim I have (version 7.2 compiled with + cursorshape) that should allow the cursor to change between insert and other modes. Unfortunately the options of Terminal seem to only allow a fixed customization of the cursor.
    On the other hand, using Vim from xterm in X11 does allow changing the colour of the cursor between insert and other modes by putting e.g.
    if &term =~ "xterm"
    let &t_SI = "\<Esc>]12;purple\x7"
    let &t_EI = "\<Esc>]12;blue\x7"
    endif
    in .vimrc but xterm seems not to be customizable in the usual way via .profile and .bash_profile to give nice ls output
    with the date/time as YYYY-MM-DD HH:MM:SS and colour coded filenames!
    For editing and compiling programs I suppose I could have two windows open, xterm and Terminal and use Vim within xterm (to facilitate editing) and directory listings etc. from Terminal but it seems there should be a better way.
    Any suggestions would be welcome.
    John Nixon

    John, would setting your TERM environment variable to “xterm-color” allow more colour flexibility in vim? Looking at the GNU ls man page, it seems as though its --time_style option would provide the means to display an ISO date format, and that its --color=always option would provide colour-coded filenames. Perhaps an alias such as
    _interactive=`echo $- | /usr/bin/tr -cd i`
    if [ "${_interactive}" = 'i' ]
    then
    alias ls='/my/gnu/ls --time_style="+%Y-%m-%d %H:%M:%S" --color=always $*'
    fi
    in your .profile would achieve your GNU ls objective?
    Or, following Jeffrey’s suggestion, you could just put the alias line alone in your .bashrc file, if bash be the only shell that you use interactively.

  • Open and closed cursor

    I have some doubts/questions .
    What is the difference between open and closed cursor?
    Are library cache locks same as parse locks?
    What is the difference between latch and mutex?
    I would be grateful if experts could answer these questions.
    Regards

    Almost correct. The terminology is however nor correct.
    Simplistically:
    The SQL engine receives a SQL. It attempts a soft parse first. This means looking for an existing cursor in the Shared Pool with the same SQL. This existing cursor can be in use by other sessions. It does not matter - if that cursor is in used (opend by other sessions), or not. It may not be in use at all and simply sitting there in the cache. If such a cursor is found, it is used for that session's SQL - and that session gets a cursor handle (reference/pointer) to that existing cursor.
    If the SQL engine does not find an existing cursor to use, it needs to create a brand new cursor in the Shared Pool. This is a hard parse. Again, the session receives a cursor handle for that new cursor created.
    And that is it.
    You now need to decide how to use that cursor handle. The cursor itself is a program. You have a handle to execute that cursor program. Via its bind interface you can input data to this cursor program. Then execute it and receive (fetch) output of that cursor program.
    So the ideal is to re-use the cursor handle again and again.
    Basic example: the following is not optimal as the same cursor is opened and closed, opened and closed, for each read from the file. A lot of soft parsing results.
    while not-eof( filehandle )   // read data from a file
      read file data into var1, var2
      open cursor for 'insert into testtab values( :1, :2)'   // create a cursor
      bind cursor :1 = var, :2 = var2  // bind values to cursor (for insert)
      exec cursor // do SQL insert
      close cursor 
    end whileThis is a lot better. A single cursor is used and executed again and again:
    open cursor for 'insert into testtab values( :1, :2)'   // create a cursor
    while not-eof( filehandle )   // read data from a file
      read file data into var1, var2
      bind cursor :1 = var, :2 = var2  // bind values to cursor (for insert)
      exec cursor // do SQL insert
    end while
    close cursor  In this case a single soft/hard parse - and the client uses that cursor handle to execute that cursor (insert data) program again and again.

  • Problem with generating xml and nested cursor (ora-600)

    I have a problem with generating xml (with dbms_xmlquery or xmlgen) and nested cursors.
    When I execute the following command, I get a ORA-600 error:
    select dbms_xmlquery.getxml('select mst_id
    , mst_source
    , cursor(select per.*
    , cursor(select ftm_fdf_number
    , ftm_value
    from t_feature_master
    where ftm_mstr_id = pers_master_id ) as features
    from t_person per
    where pers_master_id = mst_id ) as persons
    from f_master
    where mst_id = 3059435')
    from dual;
    <?xml version = '1.0'?>
    <ERROR>oracle.xml.sql.OracleXMLSQLException: ORA-00600: internal error code, arguments: [kokbnp2], [1731], [], [], [], [], [], []
    </ERROR>
    The problem is the second cursor (t_feature_master).
    I want to generate this:
    <master>
    <..>
    <persons>
    <..>
    <features>
    <..>
    </features>
    </persons>
    <persons>
    <..>
    <features>
    <..>
    </features>
    </persons>
    </master>
    If i execute the select-statement in sql-plus, then I get the next result.
    MST_ID MST_SOURCE PERSONS
    3059435 GG CURSOR STATEMENT : 3
    CURSOR STATEMENT : 3
    PERS_MASTER_ID PERS_TITLE PERS_INITI PERS_FIRSTNAME PERS_MIDDL PERS_LASTNAME
    3059435 W. Name
    CURSOR STATEMENT : 15
    FTM_FDF_NUMBER FTM_VALUE
    1 [email protected]
    10 ....
    I use Oracle 8.1.7.4 with Oracle XDK v9.2.0.5.0.
    Is this a bug and do somebody know a workaround?

    Very simple...Drop all type objects and nested tables and create them again. You will get no error. I'll explain the reason later.

  • Difference between Implicit and Explicit Cursors

    Hi All,
    Can you just tell me what is the difference between implicit and explicit cursor?
    Thanks,
    Padma

    Hi ,
    Implicit Cursor means ,the cursors which are defined impplicitly.Here we use curosr variables as "SQL%found,sql%not found,sql%is open.."
    but explicit cursors defined by us like if u create a cursor C1 then
    c1%found,c1% not found ,c1%open
    Thank you.

  • Implicit and explicit cursors

    i want to know when to it is recommended to use the implicit cursors (for rec in….) and when it is recommended to use explicit cursors(open cursors….)

    As Brett said, both methods require an explicit cursor definition. What is implicit in the FOR cursor loop is the opening and closing of the cursor. If you use a cursor FETCH loop, you need to code that explicitly yourself.
    My recommendation is to use the cursor FETCH loop and code those two additional OPEN CURSOR and CLOSE CURSOR statements. Reason: a cursor fetch loop allows for proper bulk processing code to be used. It does not rely on the implicit bulk fetching (of 10 rows per time) of a FOR cursor loop - which btw is only available in 10G.
    A FOR cursor loop does not scale. You cannot make the bulk fetching larger. Or smaller. You cannot do bulk updates or inserts in the loop.
    So I do not care what the experts think and say, for me the answer is clear cut. You want to write scalable and performant code? You will use a cursor fetch loop. Not a for cursor loop.

  • What is the real time use of implicit and explicit cursors in pl/sql

    what is the real time use of implicit and explicit cursors in pl/sql.............please tell me

    You can check the following link ->
    http://www.smart-soft.co.uk/Oracle/oracle-plsql-tutorial-part5.htm
    But, i've a question ->
    Are you student?
    Regards.
    Satyaki De.

  • Ref Cursor over Implicit and explicit cursors

    Hi,
    In my company when writing PL/SQL procedure, everyone uses "Ref Cursor",
    But the article below, says Implicit is best , then Explicit and finally Ref Cursor..
    [http://www.oracle-base.com/forums/viewtopic.php?f=2&t=10720]
    I am bit confused by this, can any one help me to understand this?
    Thanks

    SeshuGiri wrote:
    In my company when writing PL/SQL procedure, everyone uses "Ref Cursor",
    But the article below, says Implicit is best , then Explicit and finally Ref Cursor..
    [http://www.oracle-base.com/forums/viewtopic.php?f=2&t=10720]
    I am bit confused by this, can any one help me to understand this?There is performance and there is performance...
    To explain. There is only a single type of cursor in Oracle - that is the cursor that is parsed and compiled by the SQL engine and stored in the database's shared pool. The "+client+" is then given a handle (called a SQL Statement Handle in many APIs) that it can use to reference that cursor in the SQL engine.
    The performance of this cursor is not determined by the client. It is determined by the execution plan and how much executing that cursor cost ito server resources.
    The client can be Java, Visual Basic, .Net - or a PL/SQL program. This client language (a client of SQL), has its own structures in dealing with that cursor handle received from the SQL engine.
    It can hide it from the developer all together - so that he/she does not even see that there is a statement handle. This is what implicit cursors are in PL/SQL.
    It can allow the developer to manually define the cursor structure - this is what explicit cursors, ref cursors, and DBMS_SQL cursors are in PL/SQL.
    Each of these client cursor structures provides the programmer with a different set of features to deal with SQL cursor. Explicit cursor constructs in PL/SQL do not allow for the use of dynamic SQL. Ref cursors and DBMS_SQL cursors do. Ref cursors do not allow the programmer to determine, at run-time, the structure of the SQL projection of the cursor. DBMS_SQL cursors do.
    Only ref cursors can be created in PL/SQL and then be handed over to another client (e.g. Java/VB) for processing. Etc.
    So each of the client structures/interfaces provides you with a different feature set for SQL cursors.
    Choosing implicit cursors for example does not make the SQL cursor go faster. The SQL engine does not know and does not care, what client construct you are using to deal with the SQL cursor handle it gave you. It does not matter. It does not impact its SQL cursor performance.
    But on the client side, it can matter - as your code in dealing with that SQL cursor determines how fast your interaction with that SQL cursor is. How many context switches you make. How effectively you use and re-use the SQL (e.g. hard parsing vs soft parsing vs re-using the same cursor handle). Etc.
    Is there any single client cursor construct that is better? No.
    That is an ignorant view. The client language provides a toolbox, where each tool has a specific application. The knowledgeable developer will use the right tool for the job. The idiot developer will select one tool and use it as The Hammer to "solve" all the problems.

  • On startup Mac Pro I get a blue screen and a cursor on the upper left. The mouse cursor shows up independently. Is it likely a video card failure?

    On startup Mac Pro I get a blue screen and a cursor on the upper left. The mouse cursor shows up independently. Is it likely a video card failure?

    I managed to boot the computer and get the desktop to show. I now have a "repaired" computer. There are several problems that have cropped up. One is that I can only start up now in Safe Boot mode. Is there a way to turn it off? Also, I do not have a sound list, so I can't access anything requiring audio. Google Chrome only shows up as a white screen. Pictures that loaded before don't load in browsers, etc. Any suggestions? I figure I should reinstall Mac OS Lion for starts, maybe even do a mirror backup and reformat the drive. I think this drive has turned into scrambled eggs...what a headache!

  • OS7 browser problems on Torch 9810 (incl. dead touchscreen and migrating cursor)

    The browser on the Torch 9810 has two interrelated problems. On certain mobile sites -- The New York Times in particular -- one will suddenly be unable to use the touchscreen to tap open links and the cursor will remain constantly visible, slowly migrating upwards without any input from the trackpad. This usually happens right after the first time one opens a link on the sites in question. 
    Also, certain sites -- again, the NY TImes, and also ESPN -- display what seems to be generic mobile sites much different from the versions that one sees on, e.g., the 9800. I imagine that this is because the sites do not recognize the 9810 browser's user agent string.
    The first problem with the dead touchscreen and migrating cursor seems to be OS related, while the second one, I would guess, would seem to require mobile web site adminstrators or the like being made aware of the new user agent string.
    I have the 9810 on AT&T. An update from the shipping OS (7.0.0.261) to the most recent OS I'm aware of (7.0.0.336) did nothing to resolve the first problem. 
    I'm hopeful that RIM will promptly address these problems.

    Thanks for your response. I have already written the NY Times webmaster re: the user agent string. That site had a similar, but less annoying problem when the 9800 came out -- it recognized the 9800 as an iPhone. Presumably, they will address it. (I would not presume to tell the New York Times that it needs to be "more professional," however, unless you would presume to tell Le Monde that it needs to be "more professional." )
    I'm not at all sure, though, that the sudden lack of touchscreen response and permanent/drifting cursor problem that occurs after clicking on a link is the website's fault. In all cases, the generic mobile website is simply the same version that would be encountered if one visited the site on a dumbphone. A smartphone should not react this way when being dumped over to the "dumbphone" site. 
    While it may be the website's fault for not being able to adequately handle a new user agent string, and consequently dumping one over to the dumbphone site version, I would think it is RIM's fault for not designing the browser so that it would not react this way on such a dumbphone site. 

  • The select function in Pages and other apps gets stuck and the cursor will not move. What do I do?

    The select function in Pages and other apps gets stuck when I touch a word and the cursor will not move. What is the answer for this problem?

    Try reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    Note: Data will not be affected.

  • I can't use my back and forward cursor, how do I make them work?

    My forward and back cursors are not enabled.
    == This happened ==
    Just once or twice
    == My firefox shut down

    Go to '''View--Toolbars''' and make sure '''Navigation Toolbar has a checkmark next to it.
    If you do not have the menu bar either, press '''ALT V T M__ to get your menu bar back

  • Nothing is visible on my screen, except my background picture and the cursor (not even the menu bar)

    When I wanted to turn off my macbook pro, the menu bar disappeard. There's nothing visible on my screen except my background picture and the cursor. I can't even turn off the macbook with the on/off button.

    I already held it for about one minute and nothing happened.. it's like i'm not doing anything..

  • Brush and eraser cursors turn to arrow on Wacom tablet

    Hello, anyone and everyone,
    drawing with PHotoshop CS5 on the Wacom 22HD, my brush and erasor cursors will suddenly switch to the ordinary 'arrow' or 'pointer' cursor the instant the stylus touches the surface of the tablet. Any ideas as to what's going on???
    thanx!

    ..."I've allowed all Utilities, Applications, etc and no matter what, as soon as I turn on the "only allowed selected programs" option, it won't work."...
    I'm not sure, but it is possible that allowing / disallowing based on the pre-defined categories may not work because the software that Wacom uses on my system is in an atypical location, and has an atypical structure - it actually has one application contained inside another. It may be necessary to approve the apps explicitly.
    Perhaps try either:
    i) Opening "/Library" > "Application Support" > "Tablet" and explicitly dragging any apps present there into the "Parental Controls" pref pane in the panel where the programmes are listed. On my system, the app is called "PenTabletDriver.app"...
    or
    ii) Logging in to the managed account (with application restrictions in place), and trying to launch the "PenTabletDriver.app" programme. If this generates the "application is not allowed" message, it should be possible to "always allow" with "admin" authentication to white-list it at that stage...

  • Link Query and Ref Cursor Query

    Hi all!!
    How can I link Query and Ref Cursor Query??
    I mean, How can I pass input parameters to the PL/SQL procedure if they are not User parameters but they come from another table??
    Thanks a lot
    F.

    I have searched the forum and this is the closest to my problem.
    Just started using ref cursors in my reports.
    The problem I am running into is that I have two ref cursor queries in my report - they each contain a column named seq_no which forms a join (in the database) .
    My report returns the correct number of records in each query, but I can't find a way to enforce the join. I've tried all the methods I can think of including combining the results into one query.
    The IDE won't let me join on a column and when I join on the group (which I make only contain the seq_no fields) that join is ignored.
    Can anyone help me on this?

Maybe you are looking for