hisso.li
  • Login
Show Navigation
  • Public

    • Groups

Conversation

Notices

  1. matoken (matoken@gnusocial.matoken.org)'s status on Tuesday, 17-Jul-2018 06:33:44 JST matoken matoken
    vimこんなことが出来るのか
    知らなかった

    $ vim +'r!date' ~/did.txt
    $ vim +'normal Go' +'r!date' ~/did2.txt

    "did.txt file – Patrick" https://theptrk.com/2018/07/11/did-txt-file/
    In conversation Tuesday, 17-Jul-2018 06:33:44 JST from gnusocial.matoken.org permalink

    Attachments

    1. did.txt file
      By theptrk from Patrick

      Goal: create an insanely simple “did” file accessible by terminal

      Time flies by when you’re learning how to code. Its super important to take a second every once in a while to simple write down what you did during the past mental sprint. Writing down what you learned solidifies the knowledge.

      Cue the did.txt file

      This file is simply an ongoing timestamped list of what you’ve done. There are many other options, “Notes” on Mac, OneNote but since we do not want to lose the flow of coding, we need this in the terminal

      Version 1. A simple txt file

      Type in command into your terminal and simply type out what you did.

      $ vim ~/did.txt

      example did.txt file

      Version 2. A simple txt file with time stamps

      vim on your command line allows options and this includes running “ex commands”. Here we run the r read command and read the date command into the file as a timestamp at the top of the file.

      $ vim +'r!date' ~/did.txt

      Version 3. A simple txt file with natural time stamps

      Its likely more natural for you to type at the bottom of the file so with normal Go we move the cursor to the bottom before reading from the date command.

      $ vim +'normal Go' +'r!date' ~/did2.txt

      example did.txt file

      Final Version. An alias to open did.txt

      Final Step: Create your alias and add this to your .bash_profile.

      alias did="vim +'normal Go' +'r!date' ~/did.txt"

      Congrats!

      Now running $ did in your terminal will bring you to your very own did file!

      example did.txt file

       

      For more about vim

    • Help
    • About
    • FAQ
    • Privacy
    • Source
    • Version
    • Contact

    hisso.li is a social network. It runs on GNU social, version 2.0.0-alpha0, available under the GNU Affero General Public License.

    Creative Commons Attribution 3.0 All hisso.li content and data are available under the Creative Commons Attribution 3.0 license.

    Switch to desktop site layout.