My Vim Setup #2 (Mappings / Custom shortcuts)

Поделиться
HTML-код
  • Опубликовано: 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.

  • @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

  • @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.

  • @abdullahalosaimi2570
    @abdullahalosaimi2570 4 года назад +5

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

  • @charleschiang6583
    @charleschiang6583 4 года назад +2

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

  • @iliqn20
    @iliqn20 4 года назад +2

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

  • @dragonhunter250utub
    @dragonhunter250utub 5 лет назад +15

    1 month since this last video. Is everything ok ?

  • @pawemorawiak2376
    @pawemorawiak2376 5 лет назад +10

    Please continue Design Patterns series!

  • @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.

  • @gabrielmoreyra3365
    @gabrielmoreyra3365 4 года назад +3

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

  • @carstenkettner5749
    @carstenkettner5749 4 года назад

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

  • @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.

  • @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...

  • @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....

  • @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?

  • @paweniesioowski5213
    @paweniesioowski5213 5 лет назад

    Great job!!!

  • @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

  • @arnabthakuria2243
    @arnabthakuria2243 2 года назад

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

  • @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 :)

  • @user-zv7wi7kf4i
    @user-zv7wi7kf4i 4 года назад

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

  • @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.

  • @thebigVLOG
    @thebigVLOG 5 лет назад

    Great video, more vim please :)

  • @theena
    @theena 2 года назад

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

  • @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 😊😊

  • @rizwanfirdous
    @rizwanfirdous 4 года назад +1

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

  • @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 :)

  • @ucnguyenvan9230
    @ucnguyenvan9230 5 лет назад +1

    what distro do you use now ?

    • @gubasso
      @gubasso 5 лет назад

      Curious about this too!

  • @manolov4074
    @manolov4074 3 года назад

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

  • @garthok6224
    @garthok6224 4 года назад

    You have a tiny head or superlarge hands?

  • @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

  • @theemacsen1518
    @theemacsen1518 4 года назад +2

    Where have you been ? 😭

  • @andreasmalmqvist7900
    @andreasmalmqvist7900 4 года назад

    More vim videos 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.

  • @hallexcosta
    @hallexcosta 3 года назад

    How to configure the keys map with the or ?

  • @mehrdara6545
    @mehrdara6545 4 года назад

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

  • @anjalimesh
    @anjalimesh Год назад

    Worth investing my time on this video.

  • @mouadeelazzaoui8864
    @mouadeelazzaoui8864 5 лет назад

    The best notification ..

  • @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!

  • @umka7536
    @umka7536 5 лет назад

    Bang!

  • @dibyaojha6640
    @dibyaojha6640 Год назад

    Thanks 👍

  • @tapoolkeer
    @tapoolkeer 4 года назад

    How to use hjkl in comand mode?

  • @user-bw1uk4yg7o
    @user-bw1uk4yg7o 4 года назад

    I want you to upload video about DDD!

  • @PabloAndresDealbera
    @PabloAndresDealbera 5 лет назад

    Where's part 3?

  • @pauliusnarkevicius9959
    @pauliusnarkevicius9959 2 месяца назад

    Ty.

  • @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

  • @farmgatebd7858
    @farmgatebd7858 3 года назад

    is vim works by all set up in Windows ? yo

  • @ajinkyarathod5180
    @ajinkyarathod5180 3 года назад +1

    22:25 🤣️ 🤣️ 🤣️

  • @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!

  • @alejandroioio6784
    @alejandroioio6784 4 года назад

    New videos please !! regards

  • @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.

  • @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.

  • @danzaverdk
    @danzaverdk 4 года назад +1

    What happened to you?

  • @passord1d493
    @passord1d493 3 года назад

    where is the dotfiles kido

  • @chaeju106
    @chaeju106 4 года назад +1

    Dead

    • @mona.supremacy
      @mona.supremacy 4 года назад

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

  • @TarequeMdKhan
    @TarequeMdKhan 2 года назад

    honestly, the video could have been shorter.

  • @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?