My Vim Setup #2 (Mappings / Custom shortcuts)

Поділитися
Вставка
  • Опубліковано 21 січ 2019
  • The wonders of Vim, Bash and Tmux :D
    This time we talk about mapping key strokes to commands (i.e. constructing your own awesome and powerful shortcuts for absolutely anything you want) and file modifiers. You can use these shortcuts to e.g. compile your project, run your project, run your tests, or anything you can think of :)
    / christopherokhravi

КОМЕНТАРІ • 85

  • @luckboysunday
    @luckboysunday 4 роки тому +22

    Dude!! Your last upload was almost 6 months ago.. We need content.. I love your channel man..

    • @troooooper100
      @troooooper100 3 роки тому +4

      twitter.com/chrokh/status/1263076733886124034

  • @lalitmee
    @lalitmee 4 роки тому +6

    Hi, @Christopher Okhravi. Your videos are really having great content and knowledge. Thanks for making videos on vim and terminal use.

  • @dragonhunter250utub
    @dragonhunter250utub 5 років тому +15

    1 month since this last video. Is everything ok ?

  • @ChristopherOkhravi
    @ChristopherOkhravi  5 років тому +3

    Not sure why I was so confused about `%:h`. I later realized that I use `%:h` to get the folder of the current file, and ofc I've used `%:r` to get the filename without the extension. Sorry about the confusion! 😊😊

    • @PabloAndresDealbera
      @PabloAndresDealbera 5 років тому +1

      Happens to the best of us. And more importantly, I think is a good thing that you show us your thought process to approach something.
      When anyone starts programming with those tutorials that show how easy and straight forward is coding, they get mislead. The reality is you know some things, you lack most of the knowledge to solve the problem and start to try and error until you succeed.

    • @ChristopherOkhravi
      @ChristopherOkhravi  5 років тому

      @@PabloAndresDealbera Excellent points Pablo. Thanks. Much appreciated.

  • @rizwanfirdous
    @rizwanfirdous 5 років тому +11

    Please start series on Domain driven design architecture.
    Please use books in a same way how u used in design patterns series.

  • @charleschiang6583
    @charleschiang6583 4 роки тому +2

    Can’t believe myself... I finished watching this video and love it! Where is the next one?:)

  • @abdoesam2011
    @abdoesam2011 5 років тому +1

    great videos, can you tell how do you do the settings when making the active buffer have more width than the other buffers ? Thanks

  • @umka7536
    @umka7536 5 років тому +2

    Actually, you will like NeoVIM because it has all VIM features plus it has terminal in itself.
    With neovim-remote plugin you can do the following: run first instance of NeoVIM as a server, edit your files. And when needed, open terminal (":terminal" command) and using neovim-remote open files in buffers of the NeoVIM in which you run terminal session. :)
    And another useful feature for me (I write instructions, how-to, etc.) is ability of VIM to read from the command line output directly into the opened file. E.g. if I want to put in my MarkDown document basic folder structure of the project. I do from the VIM ":read !tree -d" and output of "tree -d" gets incerted in my document.

  • @abdullahalosaimi2570
    @abdullahalosaimi2570 4 роки тому +5

    It’s been 9 months! I hope you are doing well.
    We miss you bro.

  • @pawemorawiak2376
    @pawemorawiak2376 5 років тому +10

    Please continue Design Patterns series!

  • @Luxcium
    @Luxcium 4 роки тому +2

    I hope you are doing well because I am new here and I see you didn’t publish videos for 6 months...

  • @carstenkettner5749
    @carstenkettner5749 4 роки тому

    Really, really good video. I like the way you are explaining so much. Thank you very much for your efforts.

  • @iliqn20
    @iliqn20 4 роки тому +2

    Solid content! Please start uploading again. Hope everything's well : )

  • @theena
    @theena 2 роки тому

    Thank you, Christopher. My brain couldn't grasp the documentation on mappings. You solved it in 15 mins. Subbed too.

  • @user-zv7wi7kf4i
    @user-zv7wi7kf4i 4 роки тому

    Don't stop to make videos. You are amazing!!!

  • @gabrielmoreyra3365
    @gabrielmoreyra3365 4 роки тому +3

    We miss you Christopher!! Please come back! :(

  • @AlexT-zd4yj
    @AlexT-zd4yj 4 роки тому

    Did you ever try to just monitor the filesystem and build automatically when you save? Just a small script based on inotify independent of vim....

  • @mastervolcano2454
    @mastervolcano2454 2 роки тому

    Just want to say that 5:50 seconds you were right. I believe it does do with the return of the command. You can simply test this by running Clear "T" && echo "foobar" which will execute only the error (Usage of clear) and not the foobar, but if you proceed to do it with or it will execute both. Well noted!

  • @ILogger
    @ILogger 4 роки тому

    Christopher, I wonder if you used i3wm (or other window manager) instead of desktop environment.

  • @pedrosilvestre8421
    @pedrosilvestre8421 5 років тому

    You are one of my favorite CS channels! And I do somewhat enjoy your ramblings. If you mapped out everything you would say, you wouldn't be as charismatic.
    Your Design Patterns series was great for reviewing the Head First book. After finishing this series, is there any chance you can do another series on another Software Engineering concept?

  • @arnabthakuria2243
    @arnabthakuria2243 2 роки тому

    this is perfect dude, You saved me tons of time. Thank you for doing this .

  • @VictorRodriguez-zp2do
    @VictorRodriguez-zp2do 5 років тому

    In the new versions of vim you can Runa terminal inside vim and there's the plugin AsynchRun which executes a command asynchromnously and sends the input of that program to the quickfix

  • @rizwanfirdous
    @rizwanfirdous 4 роки тому +1

    Where are you??
    Waiting for your videos ?
    Hope you are well.

  • @paweniesioowski5213
    @paweniesioowski5213 5 років тому

    Great job!!!

  • @aseemlalfakawma5084
    @aseemlalfakawma5084 5 років тому +3

    You can move line down using :m +1 and up using :m -2, it's easier to map that.

    • @ChristopherOkhravi
      @ChristopherOkhravi  5 років тому

      Cool. Thanks! I didn’t know 😊😊 Thanks for sharing and for watching 😊😊

  • @AlesisManzano
    @AlesisManzano 5 років тому

    great video, question out of the blue, how do you could manage better all these knowledge, for example saw you trying to remember how || and && work in bash, I'm to start my personal log of situations that could help me in the future (same problems, same solutions)..

    • @ChristopherOkhravi
      @ChristopherOkhravi  5 років тому +2

      Good point! Thank you for sharing! Maybe a public blog would be suitable? I've often read short blog posts from people who in their blog post admit that they made the post so that they would remember whatever they were writing about :) Feel free to post a link to your blog here if you happen to start one! :) Thanks for watching and thanks for sharing your thoughts :)

  • @thebigVLOG
    @thebigVLOG 5 років тому

    Great video, more vim please :)

  • @titouant1936
    @titouant1936 4 роки тому

    In shell, && and || are short circuited -> en.wikipedia.org/wiki/Short-circuit_evaluation
    when you get a false in a AND statement, then no need to evaluate further, it's false.
    and when you get a true in a OR statement, then no need to evaluate further, it's true.
    You can try it for yourself with:
    true && sleep 3
    false && sleep 3
    true || sleep 3
    false || sleep 3
    when the command return immediately, then it got short circuited.

  • @theemacsen1518
    @theemacsen1518 4 роки тому +2

    Where have you been ? 😭

  • @manolov4074
    @manolov4074 3 роки тому

    When are some new Explanations of Software book !!! Where are the videos ! I love you and the design series ! Very amazing !

  • @logangraham2956
    @logangraham2956 4 роки тому

    if your not moving around with arrow keys then how do you move the cursor in insert mode?
    if you press j in insert mode it just inserts j into the text

    • @logangraham2956
      @logangraham2956 4 роки тому

      @Rafael Lopes or if you litterally need to just go down/up 1 or 2 lines then you can just go a head and press the arrow keys to move those lines. XD
      j j i
      seems a like a lot of work for something i can accomplish simple by pressing the down key 2 times
      but obviously for large movements i'd escape to normal mode because then it is way shorter just to use the search or other vim shortcuts

  • @garthok6224
    @garthok6224 4 роки тому

    You have a tiny head or superlarge hands?

  • @anjalimesh
    @anjalimesh Рік тому

    Worth investing my time on this video.

  • @ucnguyenvan9230
    @ucnguyenvan9230 5 років тому +1

    what distro do you use now ?

    • @gubasso
      @gubasso 5 років тому

      Curious about this too!

  • @klimmesil9585
    @klimmesil9585 2 роки тому

    you should probably try to just write :help and read the first page if you want to learn how to read the documentation best. But to be fair I think over a lifetime of using vim you will read the doc for maybe 10 hours, and 5 if you are efficient, so not a big time save

  • @hallexcosta
    @hallexcosta 3 роки тому

    How to configure the keys map with the or ?

  • @andreasmalmqvist7900
    @andreasmalmqvist7900 4 роки тому

    More vim videos please ! :)

  • @ajinkyarathod5180
    @ajinkyarathod5180 3 роки тому +1

    22:25 🤣️ 🤣️ 🤣️

  • @sobeck7020
    @sobeck7020 5 років тому

    Can you make a video about your current theme, font-family, color-scheme, font-size, etc.?

    • @ChristopherOkhravi
      @ChristopherOkhravi  5 років тому

      I'll bring up how to configure these things in a future video in this series (and will then in passing mention my settings). But the short story is that I use chriskempson's base16 for whatever terminal I'm using (iTerm on mac and gnome terminal on gnu/linux) and then chriskempson's base16-vim for vim. I then use AuditeMarlow's base16-manager to easily switch between colorschemes (since I tend to switch to light themes sometimes during the day). I'm pretty sure I'm using the default font family, and font size I just adjust on the fly depending on daily mood :) For themes I'm currently using either materia or dracula :)

  • @dibyaojha6640
    @dibyaojha6640 Рік тому

    Thanks 👍

  • @mouadeelazzaoui8864
    @mouadeelazzaoui8864 5 років тому

    The best notification ..

    • @ChristopherOkhravi
      @ChristopherOkhravi  5 років тому

      Thanks! Much appreciated :D :D Thank you for watching :)

  • @mehrdara6545
    @mehrdara6545 4 роки тому

    Ever since you stop uploading new videos I've lost my passion to learn new stuff please come back !

  • @umka7536
    @umka7536 5 років тому

    Bang!

  • @VisualBRON
    @VisualBRON 4 роки тому

    Hey Chris! Where have you gone? What you up to now?

  • @driversteve9345
    @driversteve9345 3 роки тому +1

    Hey man! It's been over a year now since we last heard from you! Maybe you won the lottery and took off? If so, atleast let us know you're alive and well! In any case, all of us hope you are doing well!

  • @pauliusnarkevicius9959
    @pauliusnarkevicius9959 2 місяці тому

    Ty.

  • @tapoolkeer
    @tapoolkeer 4 роки тому

    How to use hjkl in comand mode?

  • @farmgatebd7858
    @farmgatebd7858 3 роки тому

    is vim works by all set up in Windows ? yo

  • @user-bw1uk4yg7o
    @user-bw1uk4yg7o 4 роки тому

    I want you to upload video about DDD!

  • @Neppord
    @Neppord 5 років тому +2

    || only run the command if the previous commands fails.

    • @Neppord
      @Neppord 5 років тому

      You are looking for ; which runs the next command after the last command. If you don't have any special configuration, like always halt on error.

    • @ChristopherOkhravi
      @ChristopherOkhravi  5 років тому

      Ah dang it. Ofc! Sorry about that(!) but thank you very much for pointing it out! :D Thank you for watching!

  • @PabloAndresDealbera
    @PabloAndresDealbera 5 років тому

    Where's part 3?

  • @danzaverdk
    @danzaverdk 4 роки тому +1

    What happened to you?

  • @fyradur
    @fyradur 4 роки тому

    Yo are you Swedish? BTW loved the video, I'm a fucking normie who previously opened a new terminal, cd to the directory and typed the command, so this really enlightened me.

  • @alejandroioio6784
    @alejandroioio6784 4 роки тому

    New videos please !! regards

  • @ChristopherOkhravi
    @ChristopherOkhravi  5 років тому +2

    Audio needs improvement, agreed?

    • @Neppord
      @Neppord 5 років тому +3

      I think it's ok. Though I really liked the bigger font, watching on mobile and...

    • @AnoopD2013
      @AnoopD2013 5 років тому

      It is OK , but there is space for improvement

    • @frederickshafer7405
      @frederickshafer7405 4 роки тому

      I noticed there has been almost no uploads for the last 10 months, but after watching your design pattern series, I fully intended to watch more. Are you still creating content? I'd like to say thanks btw for your incredible series back in 2017, really helped me out this semester.

  • @passord1d493
    @passord1d493 3 роки тому

    where is the dotfiles kido

  • @TarequeMdKhan
    @TarequeMdKhan 2 роки тому

    honestly, the video could have been shorter.

  • @chaeju106
    @chaeju106 4 роки тому +1

    Dead

    • @mona.supremacy
      @mona.supremacy 4 роки тому

      It's a shame that we missed him.(I hope he's doing well )

  • @ajinkyarathod5180
    @ajinkyarathod5180 3 роки тому +1

    map
    map
    map
    map
    works in insert mode also. I dont want this

    • @fabricehategekimana5350
      @fabricehategekimana5350 3 роки тому

      You can place i before each map to also do it in insert mode:
      imap
      imap
      imap
      imap

  • @nanthakr8378
    @nanthakr8378 3 роки тому

    Vim is only useful for writing short codes nothing else. When ur code base size increases the power of vim is nothing.

    • @ChristopherOkhravi
      @ChristopherOkhravi  3 роки тому

      I happily use Vim regardless of code base size (and don’t want to use other IDEs or editors) but thank you for sharing your opinion 😊 and for watching 😊😊

    • @nanthakr8378
      @nanthakr8378 3 роки тому

      @@ChristopherOkhravi without intellisense how can u work? what codebase u have worked bro, is it a language like java, c++ or like html,

  • @RedRaion3
    @RedRaion3 4 роки тому

    I appreciate the tutoring but I think you lost yourself out of the subject a little too much.

  • @DavidTangye
    @DavidTangye Рік тому

    Better to spend 20 minutes reading bash help ('man bash') than watching someone floundering around making mistakes because he did not read the man pages himself first.
    "[bash command 1] && [cmd 2]" means "do cmd 2 if cmd 1 returns a success code.
    "[bash command 1] || [cmd 2]" means "do cmd 2 if cmd 1 returns a fail code.
    "[bash command 1] ; [cmd 2]" means "do cmd 2 whether cmd 1 returns a success or a fail code. Chris thinks this is what || does, and that is why half this video is rubbish.
    RTFM Christopher, especially before giving tens of thousands of people incorrect information!

  • @enterusername7746
    @enterusername7746 2 роки тому

    This guy talks too much

  • @5kplamse
    @5kplamse 4 роки тому

    what happened to you?