Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fortran fixed format #71

Open
hholst80 opened this issue Jun 23, 2016 · 6 comments
Open

Fortran fixed format #71

hholst80 opened this issue Jun 23, 2016 · 6 comments

Comments

@hholst80
Copy link

hholst80 commented Jun 23, 2016

I would like to be able to comment Fortran source using a capital C in column 1. It does not have to be the default mode of action but it would be nice to manually set it, for instance if fortran_fixed_source is set.

Pressing 3gcc on the first line below should toggle between the two code snippets

      IF (DBG) THEN
        WRITE(*,*) 'DEBUG: ', XDATA
      END IF
C     IF (DBG) THEN
C       WRITE(*,*) 'DEBUG: ', XDATA
C     END IF
@tpope
Copy link
Owner

tpope commented Jun 24, 2016

I'd entertain providing some sort of generic hook for this (which could also be used for other weird comment schemes like COBOL).

@jkulesza
Copy link

jkulesza commented Jun 5, 2017

To expand on @hholst80's request, I recently came across this fork of vim-commentary that handles the functionality that I think accommodates his request and your rebuttal: forcing vim-commentary to insert the comment character in a particular column. In this instance, new variables are introduced: g:commentary_fixed and g:commentary_fixed_pos.

It doesn't look like @foodbag has made a pull request, but I hope you might consider adding it to your own plugin with proper attribution.

P.S. Sorry for the previous misfired issue in vim-pathogen (too much clicking, not enough reading).

@tpope
Copy link
Owner

tpope commented Jun 5, 2017

Original request concerned support for the formatting requirements of specific languages, while the fork in question is a global behavior override with motivations I can only guess.

@nitej
Copy link

nitej commented Jun 5, 2017 via email

@jkulesza
Copy link

jkulesza commented Jun 6, 2017

Original request concerned support for the formatting requirements of specific languages, while the fork in question is a global behavior override with motivations I can only guess.

My thought was that the fork might provide a mechanism to satisfy @hholst80's goal of specifying a Fortran fixed-format comment (and perhaps your COBOL comment scheme remark). My goal is also fixed-format Fortran and misc. input files that have a similar comment format. While a cleaner implementation is preferable, @foodbag's method of setting g:commentary_fixed and g:commentary_fixed_pos in .vimrc (or ftdetect or ???) would work for me.

Any time/effort you put toward including the ability for fixed-position comments would be appreciated!

@tpope
Copy link
Owner

tpope commented Jun 6, 2017

Start by making it a single buffer local variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants